db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Torque and JTA
Date Tue, 30 Sep 2008 16:12:04 GMT
> Is there a way for torque and jta to play well together?
> 
> I would like jta to handle the transactions, which I understand requires 

> making sure that a DataSource is used for the database, which doesn't 
> seem to be a problem.
> 
> The generated torque code however uses a JDBC transaction instead - is 
> there a way to work around this at all?
> 

I am not really qualified to answer this, because I do not know how JTA 
works internally. So use healthy scepticism with the answer below.

With all external transaction frameworks, the problem is that at the 
moment, Torque does not have a "Transaction Info" object which is passed 
around in a transaction, it only passes a jdbc connection around (There is 
a Transaction object but it does not contain information about the current 
transaction). So the problem is that there is not really a way to pass 
transaction info around.

But maybe one can use a custom Data source providing a custom Connection 
wrapper object which contains the connection information and the 
transaction information. This would probably mean some ugly casts, and 
patches to the Torque Transaction object, but perhaps it could work.

   Thomas


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message