You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Brian McCallister <mc...@forthillcompany.com> on 2004/03/20 14:49:30 UTC

OTM NPE w/ Transactions

The OTM throws an NPE if a transaction is acquired, and used, via 
OTMConnection#getTransaction() initially instead of 
OTMKit#getTransaction(OTMConnection) because the insertInternal uses 
the OTMKit set by the kit on getTransaction

A while back there was a start on a discussion about the 
OTMConnection#getTransaction and setTransaction which never really got 
resolved. Should these methods exist? If they do, what should they do? 
Right now they are useless -- setTransaction always throws an 
exception, and getTransaction gives an improperly initialized object.

The ConcreteEditingContext pulls the kit from the Transaction and pulls 
the SwizzlingStrategy from the kit -- the immediate solution I see is 
to let the editing context be aware of the swizzling strategy or the 
kit -- this won't change behavior as swizzling strategy is specified 
for the whole kit, it isn't variable based on the class descriptor etc.

The bigger question is still how to do multiple connections : one 
transaction. IIRC Raghu recommended requiring a different transaction 
factory, which would require a subclass of kit which would have 
something like MyKit#acquireConnectionInTx(pbkey, transaction) which 
works, I guess, but I prefer the idea of an initially acquired 
connection not already being bound to a transaction (initially closed 
tx, but still bound) and having getTransaction create a new one if one 
is not set. As the connection is already intimately tied to the 
transaction factory I don't think this hurts us.

Thoughts?

-Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org