> If somebody knows for sure the answer to the following question,
> please, tell me.
> Can a bean get Connection instance during one method call and store in
> a bean instance field for use in subsequent calls of this or other
> methods?
No. This is a limitation of the current DataSource implementation. The
problem is that when you do getConnection() you get a wrapper connection
that actually holds a real connection under the hood. Since the XA hooks are
in Connection.close() it is not possible to get a connection wrapper and
reuse it a lot of times.
IMHO the connection wrapper should be recoded so that a connection is
retrieved for each Connection call ( vaguely remember this being discussed
some while back). This will
a) allow Connections to be gotten in setInitialContext() and reused many
times
b) make it impossible for beans to "steal" connections and not hand them
back
Aaron, any comments on this?
> I understand that in any case that would be a bad practice,
> and I know why.
> But if the specification strongly prohibits it, I think that jBoss
> could collect such garbage Connections after the method ends and
> return them to the pool.
As above: beans should be able to misbehave, or simply think that it is
possible to do as you outline, but under the covers we should make this
acceptable. I don't think it's even very hard to code so...
/Rickard
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]