Hi Jens,
we currently discuss to find a better solution as associate the thread
with the database.
Till we found a 'sage' solution, best is to open database within every
method (this should work with further versions too):
public void aMethod()
{
try
db.open(...);
tx = odmg.newTransaction();
.... do something
tx.commit();
}
finally
{
db.close();
}
}
HTH,
Armin
----- Original Message -----
From: "Jens Kr�mer" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, August 29, 2002 1:45 PM
Subject: multiple Databases with ODMG
> Hi all,
>
> I'm trying to use the ODMG API with multiple repositories/Databases.
> Since OJB.java can only hold one open database per thread I always
> have to call
>
> ((OJB) odmg).setCurrentDatabase (dbIWantToUseNext);
>
> before getting a new Transaction with
> tx = odmg.newTransaction ();
>
> Is there any "best practice" for what I'm trying and/or is it ok the
way
> I do it at the moment ?
>
> The testcase I've written (see attachment) works so far, but next step
> is to get it working with multiple threads...
>
> thanks for any response,
>
> Jens
>
> --
> Jens Kr�mer
> [EMAIL PROTECTED]
>
------------------------------------------------------------------------
--------
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>