Hi again,

----- Original Message -----
From: "Emmanuel Dupont" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>; "'Armin Waibel'"
<[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2003 10:14 AM
Subject: RE : LocalTxManager delete the only current Thread available
???


Hi Armin,

With the join() it works.


Does that means that I can only use inner transactions when I work with
multi-threading ? Or I all time have to use the join ()...?
#########
Think this has nothing to do with multi-threading. The problem is
that the ODMG implementation can't handle multiple tx (inner/nested tx)
of one thread at the same time. Thus you have to call join() to
re-register
a tx when an inner tx was used before.



I have some BusinessObjects who works directly with the JDO objects,
does
that means that I must have an instance variable in the mother class of
my
business objects, because I don't use multi threading and so, I only
will
have only one thread, so the transaction is an instance variable....?
########
Sorry, I don't understand what you mean.

regards,
Armin

Thanks again for your replies Armin !




-----Message d'origine-----
De : Armin Waibel [mailto:[EMAIL PROTECTED]
Envoy� : lundi 30 juin 2003 18:12
� : OJB Users List
Objet : Re: LocalTxManager delete the only current Thread available ???

Hi,

per thread you only can perform one transaction. Currently nested
tx are not supported.
Do you have tried do a tx.join() call before the last
tx.lock(...) method call?

regards,
Armin

----- Original Message -----
From: "Emmanuel Dupont" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Monday, June 30, 2003 4:24 PM
Subject: LocalTxManager delete the only current Thread available ???


All



I think I found a bug or my implementation doesn't create thread
properly.



Here is my code sample with ODMG API:



------------------------------------------------------

T1 = new Transaction();

T1.begin();



[...]

While (i<size) {

T2 = new Transaction();

T2.begin();



[...]



T2.commit();

}



ojb = new PObject();

T1.lock(obj, WRITE);



T1.commit();

----------------------------------------





It failed in the last lock with the message :

org.odmg.TransactionNotInProgressException: Calling method needed
transaction, but no transaction found for current thread :-(

      at
org.apache.ojb.odmg.LocalTxManager.getCurrentTransaction(LocalTxManager.
java
:46)





When I traced in Ojb code and I understand this processes:



In TransactionImpl the begin() do : txManager.registerTx(this);



The LocalTxManager call

registerTx(TransactionImpl tx) :

tx_table.put(Thread.currentThread(), tx);





It puts the current Thread in the tx_table (TransactionTable)





The trouble is on the commit off The T2 transaction:



The TransactionImpl 's commit call the doClose method and who call :

LocalTxManager : deregisterTx(Object token)

tx_table.remove(Thread.currentThread());



But the T2 transaction is attached to the same Thread as T1, so at the
last
T2.commit() call the tx_table doesn't contains the current-Tread anymore
!!!
And when T1 wants to work it failed !!







First question: Is it normal that T2 is on the same Thread as T1 ? So
the
commit method, delete the Thread reference in the LocalTxManager 's
tx_table.



Second question What can I do ??





Any help whould be really appreciated.



Thanks a lot in advance!!







Emmanuel.













---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to