Title: simultaneous transactions in different threads

Hi again,

Castor is amply filling my needs up until this point. Looking forward to using it further! Good job to those involved.

The current problem I'm having is accessing transactions from multiple threads. I have several created threads in one thread group. Each thread executes:

db.begin();
db.create( some new object );
db.commit();

The db object is shared among all threads. When they overlap, exceptions are thrown because it can't start a transaction for all but the first thread.

Does this mean I have to jdo.getDatabase() for each thread? What is the overhead involved in this?
Esentially because of the application's design this will mean each transaction gets a new instance of the database, which could be very expensive.

I have looked at the code in CVS - I expected only to see the getDatabase() call getting a new connection to the actualy database but it appears to me to be doing a whole lot more so I'm not sure if it is such a good idea.

Regards,
Brett

~*~*~*~*~*~*~
Brett Porter
Web Developer, f2 Fairfax Interactive Network, Australia
Ph: +61 2 8596 4437
Email: [EMAIL PROTECTED]

Reply via email to