Hi all,

Just trapped a little bug in the StatementManager.closeResources()
method, as follows:

When in a PB transaction under eager-release mode, the StatementManager
closes the connection which then causes any updates within the
transaction to be lost.

Simple workaround is as follows (in method
StatementManager.closeResources()):

if (m_eagerRelease) {
                 if (broker.isInTransaction()) {

                        //CL: don't close the connection yet as updates
will be lost!!
                    }
                    else {

broker.getConnectionManager().releaseConnection();
                    }
 }

I left the logic like that rather than test for a negative as it helps
me to read why I shouldn't close things - feel free to hack it around.

By the way, how can you keep the connection open until you want to close
it? I may be missing something but it seems as though the connection
gets closed (in eager-release) every time a statement gets executed,
which could be a bit expensive when doing lots of queries.

Cheers,

Chris


--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to