Any takers for this?

I just want to validate my code - that I'll be posting with an online article. I hope that way this question will not need to answered again and again. I know it has been answered earlier, but the mail achieves do not take it to conclusion.

 

Thanks in advance,

Harshal

 

 Harshal D <[EMAIL PROTECTED]> wrote:

Hi,

 

While trying to decide a strategy for use of CASTOR in a heavily concurrent web app,  I referred to the mail thread at: http://www.mail-archive.com/[EMAIL PROTECTED]/msg10198.html

 

Here Bruce says:

 

Let's say that you have a threaded client that kicks off, say, ten
> SR>threads that all use Castor, each of which grabs a Database object and
> SR>each begins a transaction. Castor does not keep track of who is using
> SR>what Database object so when one of the threads (clients) commits its
> SR>transaction, Castor just commits the closest open transaction. This

      SR>may or may not be the correct transaction to commit.�

 

The part that is confusing to me � �Castor does not keep track of who is using what Database object� 
 
Does this mean if 10 separate programs all use the same JDO instance but call getDatabse() and perform totally un related work � will still face the same problem? That is CASTOR will not know which database object to commit & close ? Even if �database object� is a local variable ?
 
Can any one!
 please comment ?
 
 

In my case I have a singleton that ensures there is only one JDO instance.

 

My client code looks like:

{

// The JDOObject is sort of a factory that returns the only JDO //instance. Every client gets a separate databse object

mySQLDB=  JDOObject.getDatabase();

 

//Now I start the TXN

 

mySQLDB.begin();

 

// query and get results � do updates

 

mySQLDB.commit();

mySQLDB.close();

 

}

 

I am using STRUTS and this code appears in one Action class. I can synchronize the entire piece of code inside the braces ( �{�). But this exact similar code will be there in other Action classes. They may be querying updating different tables all together.  If CASTOR just closes the �closest open transaction� � how will this affect?

 

THANKS A LOT for your help .



Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!



Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

Reply via email to