connections are not modified in the pool code (IIRC). Transaction code
should always include a rollback command in the exception handling,
BasePeer contains a helper methods that will return the connection in a
good state, you can use them or use them as an example.
Some questions, in the event cleansing code is ever added:
Would it be considered good form for a connection pool to assume if a
connection returned while still set to autoCommit=false the pool should
rollback any changes? What happens if the transaction is committed but
autoCommit is just forgotten, will calling rollback have any bad
effects? What happens if setAutocommit(true) is called without a prior
commit or rollback?
john mcnally
Gabriel Moreno wrote:
>
> Hi,
> I have the same question that was posted a while ago, but I'm not sure
> what NONE is referring to in the answer.
> Is it that no state is retained or that no cleansing is done?
> I don't want to do anything strange; just be sure that I include all the
> necessary try catch blocks when doing transactions.
>
> My specific concerns are:
> -if I've changed some state in the connection, such as
> setAutoCommit(false), is that change reset when the connection is
> released?
> -if I've set AutoCommit to false to create a transaction and for some
> reason the connection is returned to the pool with an operation neither
> committed nor rolled back, does that transaction remain open?
>
> Thanks in advance,
>
> Gabriel
>
> Jon Stevens wrote:
> >
> > on 5/30/01 1:28 AM, "Myron Ahn" <[EMAIL PROTECTED]> wrote:
> >
> > > Quick question about connection pooling: if you use a connection and do
> > > something like lock some tables, then release the connection back into the
> > > general pool, will the connection still retain its 'state' of having the
> > > locked tables? What kind of 'cleansing' is done to the connection before it
> > > is placed back into the pool?
> > >
> > > Thanks,
> > > -Myron
> >
> > None at all and doing what you suggest would seriously break your
> > application.
> >
> > -jon
> >
> > --
> > If you come from a Perl or PHP background, JSP is a way to take
> > your pain to new levels. --Anonymous
> > <http://jakarta.apache.org/velocity/ymtd/ymtd.html>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]