-
1. Re: Connection handle has been closed and is unusable
alanlynott Aug 10, 2007 1:52 AM (in response to msduk)I'm getting the same problem. I'm wondering whether it's mySql because I've been told it's concurrent transaction handling is poor. I'm going to move to Postgres today to see if there are any improvements.
Thanks, AL. -
2. Re: Connection handle has been closed and is unusable
monkeyden Aug 10, 2007 2:00 AM (in response to msduk)Check the manifest file in the hibernate3.jar file. If it's 3.2.0 GA, upgrade it to 3.2.5GA. I just had this problem the other day.
reference:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2206
download:
http://www.hibernate.org/6.html -
3. Re: Connection handle has been closed and is unusable
monkeyden Aug 10, 2007 2:01 AM (in response to msduk)I upgraded the hibernate versions in Seam 1.2.1 to the latest hibernate which definitely reduced the frequency however they are still there. Any suggestions welcome.
Oops, sorry. It's 2:00AM here. Sleepy. -
4. Re: Connection handle has been closed and is unusable
monkeyden Aug 10, 2007 2:06 AM (in response to msduk)Incidentally, why are you using an aggregate function in your test SQL statement? Doesn't MySQL have a dummy table like Oracle "dual", where you can write a simple query like:
SELECT 1 FROM dual -
5. Re: Connection handle has been closed and is unusable
msduk Aug 10, 2007 5:09 AM (in response to msduk)I'm getting the same problem. I'm wondering whether it's mySql because I've been told it's concurrent transaction handling is poor. I'm going to move to Postgres today to see if there are any improvements.
Thanks, AL.
I am pretty sure it isn't down to mysql's concurrency ability but I did think it might be some configuration issue or one with the drivers. Grateful for the feedback. -
6. Re: Connection handle has been closed and is unusable
msduk Aug 10, 2007 5:19 AM (in response to msduk)SELECT 1 is actually valid mysql syntax (although I have never understood why). I will switch to that and save some cpu cycles.
-
7. Re: Connection handle has been closed and is unusable
monkeyden Aug 10, 2007 11:52 AM (in response to msduk)The real question is, how do you ever see the issue when using <check-valid-connection-sql>? The connection is obviously bad but that fact wasn't picked up by the check. Post the whole <local-tx-datasource> node, minus the p/w, of course.
-
8. Re: Connection handle has been closed and is unusable
msduk Aug 10, 2007 12:02 PM (in response to msduk)<local-tx-datasource> <jndi-name>nrg2Datasource</jndi-name> <connection-url>jdbc:mysql://localhost:3306/db</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>db</user-name> <password>pass</password> <exception-sorter-class-name> org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter </exception-sorter-class-name> <metadata> <type-mapping>mySQL</type-mapping> </metadata> <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name> <check-valid-connection-sql>SELECT count(warehouseId) FROM warehouse</check-valid-connection-sql> <new-connection-sql>SELECT count(warehouseId) FROM warehouse</new-connection-sql> </local-tx-datasource>
-
9. Re: Connection handle has been closed and is unusable
mjz Aug 10, 2007 4:10 PM (in response to msduk)this sounds strangely familiar... looking back at my -ds.xml ive got failed attempts commented out all over the place, but the last two days tags seem to have resolved the issue( configure by coincidence i always say):
... <!-- 20march2007--> <track-statements>true</track-statements> <min-pool-size>0</min-pool-size> <!-- change pooling to use jta 21march2007 --> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>4</idle-timeout-minutes> </local-tx-datasource> </datasources>
dunno what that jta pooling bits about
/matt