#5 Incorrect unresolved transaction messages

closed
Steve Waldman
None
5
2004-11-19
2004-11-10
David Graham
No

I just started using c3p0 0.8.5-pre7a with hibernate
and am seeing lots of "Rolling back potentially
unresolved txn..." messages on stderr. This happens
when I simply run a select statement which, of course,
needs neither a commit nor rollback.

A rollback should only occur when the connection was
used for a database modification like an update
statement.

The current behavior isn't helpful because we don't
know if it was a false alarm (select statement) or if
we closed a connection without committing/rolling back
an update properly. Thanks!

Discussion

  • Steve Waldman
    Steve Waldman
    2004-11-10

    Logged In: YES
    user_id=175530

    Hmmm... depending on the transaction isolation level, even a SELECT
    may imply an unresolved transaction that needs to be resolved... though
    in the select case, most users would just want that to happen
    automatically and silently on close(), without being chided about how
    they ought to have rolled-back. I'll try to tighten the logic behind this
    warning. It's complicated though -- selects may lead to updates via
    ResultSets, for example, and string comparisons of queries to test if they
    are selects are slow. Perhaps it's best to just not warn, and
    conservatively rollback where there might potentially be unresolved
    work. This was the previous behavior, except previously c3p0 rolled-back
    ultraconservatively, even if their was no chance that any unresolved
    transactional work existed.

     
  • Steve Waldman
    Steve Waldman
    2004-11-10

    • assigned_to: nobody --> swaldman
     
  • Steve Waldman
    Steve Waldman
    2004-11-19

    Logged In: YES
    user_id=175530

    OK. This behavior is turned off for now, since getting the message only
    when users would want it would involve logic more expensive than it's
    worth. See the CHANGELOG for more details.

     
  • Steve Waldman
    Steve Waldman
    2004-11-19

    • status: open --> closed