db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raghuram Rajah <raghuram.ra...@s1.com>
Subject RE: OTM + Connections/Transactions
Date Tue, 23 Sep 2003 19:50:35 GMT
Sorry, I take back what I had mentioned, that was inaccurate. 

This problem is something I had wrestled with early on in OTM. Here's the
premise of the current implementation.

The environment determines how connections are associated to transactions.
There are limitations on how connections and transactions can be associated
in an app server environment - be it managed or user transaction.
Connections that sit in the same thread will automatically scope themselves
into an active transaction. In a local environment this is not the case,
clearly because there is no intervening app server.

In the current implementation, if you acquire more than one connection
within a single thread in an app server environment (be it managed or user),
they automatically scope themselves into the same transaction. In a local
environment, every connection is in the scope of its own transaction. So, if
you ask for a new connection, it will be in its own transaction. There is no
way to associate a local connection into an existing transaction. And why
would one want to do that? I could not think of a single reason why one
would want to do that. If you think you have a valid reason, it should be
very trivial to implement. A new transaction factory will do the trick. Of
course, you need to establish some connection-transaction association model,
maybe in lines of J2EE.

HTH.

Thanks,
 Raghu.



-----Original Message-----
From: Brian McCallister [mailto:mccallister@forthillcompany.com]
Sent: Tuesday, September 23, 2003 3:25 PM
To: OJB Developers List
Subject: Re: OTM + Connections/Transactions


I think a better way might be to not assign connections a transaction 
until they need one; change transaction.registerConnection() to take an 
OTMConnection instead of a BaseConnection; and then allow a newly 
aquired, but as yet unused, connection to be added to a transaction via 
Transaction.registerConnection().

I have actually almost finished making these changes ;-)

-Brian

On Tuesday, September 23, 2003, at 03:20 PM, Raghuram Rajah wrote:

> Hi Brian,
>
> The trick is to get to the tx factory. But I realize that there is no 
> clean
> way to do that. I will add a new API into the Kit that will allow you 
> to
> acquire new connections within the scope of a particular transaction.
>
> Raghu.
>
> -----Original Message-----
> From: Brian McCallister [mailto:mccallister@forthillcompany.com]
> Sent: Tuesday, September 23, 2003 11:40 AM
> To: OJB Developers List
> Subject: OTM + Connections/Transactions
>
>
> One of the stated features of the OTM is that it supports multiple
> connections in one transaction -- however, I cannot figure out how to
> do this. I have patched up OJB so that you can bind a connection to a
> transaction (in OTM) after creating the connection, but... I want to
> make sure I am simply not missing something obvious.
>
> Raghu, Matt? Any tips on using multiple connections per transaction?
>
> -Brian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>



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

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


Mime
View raw message