db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chas douglass <chas.dougl...@gmail.com>
Subject Re: Invalid SQL State
Date Sun, 30 Oct 2005 20:01:11 GMT
Michael J. Segel <msegel@...> writes:

> 
> On Sunday 30 October 2005 08:46, Chas douglass wrote:
> > I'm using Derby embedded 10.1.1.0 with Hibernate 3.0.5.  I have one thread
> > running, iterating through a number of transactions.  A second thread
> > starts up, performs 0 or more transactions, and then ends.  At this point,
> > thread 1 gets:
> >
> > 06:34:05,431  WARN JDBCExceptionReporter:71 - SQL Error: 20000, SQLState:
> > 25000 06:34:05,431 ERROR JDBCExceptionReporter:72 - Invalid transaction
> > state. org.hibernate.exception.GenericJDBCException: Cannot close
> > connection
> >
> > I get no errors unless the two threads overlap.
> >
> > Can anyone provide any insight into what this error is trying to tell me? 
> > Or, perhaps, suggest what further information would be necessary?
> >
> > Thanks.
> >
> > Chas Douglass
> Your  code isn't thread safe?
> 

Um... thanks.

All of my db access is through Hibernate, and I'm using the ThreadLocal Session
Factory pattern.

Briefly, that means that each thread grabs a new Hibernate Session instance when
it starts, uses that session instance for 0-n transactions, and then closes that
session just before exiting.

Hibernate claims their Session to be thread safe.

What I was hoping for was some more explanation of what "Invalid SQL State"
meant to help me track it down.

Years ago (and I mean YEARS ago) I was working on a Basic interpreter and we
almost included an error "SOMETHING WRONG WITH PROGRAM".  At least we understood
it was a joke.

Chas Douglass





Mime
View raw message