exe and application reading and writing database
hi
i have a background exe which continuously writes some data to the database
now when the exe is writing the data, another application reads some data from the same database.
this application also controls the exe(starts and stops it).
first i get System Error -14(database already in use i suppose) while opening the databse for reading.
then when i actually prepare the database for the sql query, i get DBMS 2 panic which means database parameter
has remained uninitialized.
but if i read the same database when background exe is not writing to it, i am able to read it properly.
i am using the following code to open the database
[CODE]
TInt errCode = iItemsDatabase.Open(iFsSession, DBFileName,_L(" "),RDbNamedDatabase::EReadWrite);
[/CODE]
where [I]iItemsDatabase[/I] is [B]RDbNamedDatabase[/B] and DBFileName is the path of the .db file
what i think of is, do i actually need to open the database from the application while the background exe
is still writing to database? i am saying this because the database is already opened by the background exe
what should i do here?
can u suggest me what might be the problem in here or give a hint or some solution?
rajesh
Re: exe and application reading and writing database
[QUOTE=raj8nokiaforum;653126]
what i think of is, do i actually need to open the database from the application while the background exe
is still writing to database? i am saying this because the database is already opened by the background exe
rajesh[/QUOTE]
every process has its own handle(can be of any resources) it is not shared with other process.
so u require to open that database in other app but take care operation happening from both processe should change/affect the database
Re: exe and application reading and writing database
what do u mean by another app by the way?
the background exe i suppose is a seperate entity in itself. Tell me if i am wrong..
what do u suggest ?
Re: exe and application reading and writing database
The RFs-variant of RDbNamedDatabase::Open uses the database [B]file[/B] in exclusive mode, so the KErrInUse is just true.
Try the RDbs-variant, since in this case the database server would open the file only once, and you would have multiple sessions to the server.