×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    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);
    where iItemsDatabase is RDbNamedDatabase 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

  2. #2
    Registered User
    Join Date
    Nov 2008
    Location
    Mumbai-India
    Posts
    379

    Re: exe and application reading and writing database

    Quote Originally Posted by raj8nokiaforum View Post
    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
    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

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    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 ?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,740

    Re: exe and application reading and writing database

    The RFs-variant of RDbNamedDatabase::Open uses the database file 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.

Similar Threads

  1. problem Auto starting application in 3rd edition FP1
    By gaurav.gupta in forum Symbian
    Replies: 24
    Last Post: 2009-04-10, 17:20
  2. EXE programming : should i use thread ?
    By nono240 in forum Symbian
    Replies: 2
    Last Post: 2007-01-31, 21:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×