Subject | Re: Two XA bugs |
---|---|
Author | Ludovic Orban |
Post date | 2006-03-27T11:32:41Z |
Roman,
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
<rrokytskyy@...> wrote:
The bad news is that it's perfectly legal to get more than one
connection out of an XA connection.
The good news is that 99% of the time users simply get a connection
from the XA connection then close it and it looks good enough for all
cases I can think of.
Quite frankly, I'm as clueless as you are regarding what the proper
implementation should be.
The two implementations I've seen regarding this problem are:
1) the second call to XAConnection.getConnection() automatically
closes the first logical Connection before retuning you a new logical
Connection object using the same physical connection.
2) the second call to XAConnection.getConnection() returns you another
logical connection using the same physical connection. Both logical
connections can be used in parallel and closed separately.
For me it looks clear that the 2nd option looks best but it's also the
most complex to code.
At the very least the first option or some other compromise should be
implemented so that calling multiple times
XAConnection.getConnection().close() won't barf as badly as it does now.
Ludovic
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
<rrokytskyy@...> wrote:
> Since there is no method to return connection to the pool, thismeans such
> code is implementation specific. In our case it is returned to thepool when
> logical connection is closed. Now, when you try to obtain logicalconnection
> for the second time, the physical connection is in pool. We do notdetect
> this situation and after that all goes wrong...therefore
>
> As to the XAConnection... it is subclass of the PooledConnection,
> it should have same semantics as PooledConnection.have not
>
> So, we have quite controversial results... and the worst is that I
> seen neither confirmation of your usage scenario nor that mine usageLet's speak XAConnection since it's the root problem of this story.
> scenario is the only possible.
>
> What do we want to do now?
The bad news is that it's perfectly legal to get more than one
connection out of an XA connection.
The good news is that 99% of the time users simply get a connection
from the XA connection then close it and it looks good enough for all
cases I can think of.
Quite frankly, I'm as clueless as you are regarding what the proper
implementation should be.
The two implementations I've seen regarding this problem are:
1) the second call to XAConnection.getConnection() automatically
closes the first logical Connection before retuning you a new logical
Connection object using the same physical connection.
2) the second call to XAConnection.getConnection() returns you another
logical connection using the same physical connection. Both logical
connections can be used in parallel and closed separately.
For me it looks clear that the 2nd option looks best but it's also the
most complex to code.
At the very least the first option or some other compromise should be
implemented so that calling multiple times
XAConnection.getConnection().close() won't barf as badly as it does now.
Ludovic