Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Berkely DB > Re: DB::put fun...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 9 Topic 1756 of 1805
Post > Topic >>

Re: DB::put function is getting hanged

by rohithravi@[EMAIL PROTECTED] Jun 21, 2007 at 02:13 AM

On Jun 18, 8:58 pm, Don Anderson <don.ander...@[EMAIL PROTECTED]
> wrote:
> On Jun 11, 9:20 pm, rohithr...@[EMAIL PROTECTED]
 wrote:
>
>
>
> > On Jun 12, 4:33 am, Florian Weimer <f...@[EMAIL PROTECTED]
> wrote:
>
> > > > Am a fresher in BerkeleyDB. If i open a database file(using
> > > > transaction) for put(adding to DB) and if i tried to open the same
> > > > file in different transaction the put is hanging. It seems a
deadlock
> > > > is occuring. Is it not allowed, the same database file to be
opened in
> > > > more than one transactions?
>
> > > It's allowed, but only if the threads or processes executing the
open
> > > and the put are ordered in some way unknown to Berkeley DB.  If
you've
> > > got a single process that tries to do these things, they are
trivially
> > > ordered, so it's not allowed.  Another source of orderings is IPC.
>
> > Thanks. My concern is in a single process.
>
> > The number of database files in not defined in my work.
> > So i think I need to use a single transaction in my process. Will it
> > be OK to open more than 1 database files in a single transaction?
>
> It's okay, but probably not your best bet.  Why not open each database
> in
> its own transaction (use autocommit flag so you don't even have to
> manage
> the transaction).  The only reasons I know to keep a transaction going
> past the end of the open would be 1) you are creating your set of
> databases atomically and you want the behavior where either all your
> databases were created or none.  or 2) performance - you are opening
> 1000 databases, I'd guess you'd see an open using a single transaction
> to be faster then separate transactions.  Same advice goes for your
> original question if I understand it.  Open the database in its own
> separate transaction (use autocommit), and then do puts in their own
> transaction.  That's the typical approach anyway.

So you are saying that explicit transaction is not necessary, simply
auto-commit may be needed. So the implicit transaction which we get by
auto-commit will work, am I right?
I have one more doubt. Hope if the database count is less, then there
is no problem(even for performance) in creating multiple transaction
under the same environment, am i right?
 




 9 Posts in Topic:
DB::put function is getting hanged
rohithravi@[EMAIL PROTECT  2007-06-10 20:06:01 
Re: DB::put function is getting hanged
sylecn@[EMAIL PROTECTED]   2007-06-11 11:21:02 
Re: DB::put function is getting hanged
Florian Weimer <fw@[EM  2007-06-11 21:33:59 
Re: DB::put function is getting hanged
rohithravi@[EMAIL PROTECT  2007-06-11 18:20:41 
Re: DB::put function is getting hanged
Don Anderson <don.ande  2007-06-18 04:58:22 
Re: DB::put function is getting hanged
rohithravi@[EMAIL PROTECT  2007-06-21 02:13:42 
Re: DB::put function is getting hanged
Don Anderson <don.ande  2007-06-22 19:34:03 
Re: DB::put function is getting hanged
rohithravi@[EMAIL PROTECT  2007-06-27 20:40:57 
Re: DB::put function is getting hanged
rohithravi@[EMAIL PROTECT  2007-06-27 20:45:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 6:49:53 CDT 2008.