This discussion is archived
2 Replies Latest reply: Aug 20, 2012 6:57 PM by vinothchandar RSS

Dumb Database open() close() question

vinothchandar Newbie
Currently Being Moderated
I think I understand this right. But want to confirm if its true

If I do a

Database db = env. openDatabase(....)

// do some db operations
..
..

and then
db.close()

this does not impact in any way other database handles that are open for the same db right?
  • 1. Re: Dumb Database open() close() question
    greybird Expert
    Currently Being Moderated
    When you open multiple handles for the same DB, the DB is not closed internally until the last handle is closed. It's simple reference counting.

    --mark                                                                                                                                                                                                                                                                                                                       
  • 2. Re: Dumb Database open() close() question
    vinothchandar Newbie
    Currently Being Moderated
    Cool. Thanks.. I am just opening a Db handle so I can do a db.count(). So, closing after I am done should be fine then.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points