-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: does SessionFactory timeout?
PostPosted: Fri Jul 13, 2007 1:08 am 
Beginner
Beginner

Joined: Thu May 17, 2007 2:41 pm
Posts: 48
I have an app which was just uploaded to the deployment environment. This the the first time I left it running for many hours continuously, and got a new type of error.


# JDBC rollback failed
# No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error: ** BEGIN NESTED EXCEPTION ** com.mysql.jdbc.CommunicationsException MESSAGE: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Broken pipe STACKTRACE: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2689) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2618) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1551) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:2978) at com.mysql.jdbc.Connection.execSQL(Connection.java:2902) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:930) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1787) at org.hibernate.loader.Loader.doQuery(Loader.java:674) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.loadEntity(Loader.java:1860) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3042) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808) at

The only thing that I can think of is that I use a singleton to store a single instance of SessionFactory, and each time I do data access, I would call sessionFactory.getCurrentSession();

is it possible that SessionFactory can timeout? there is not enough info on java doc to know if that's true.

Does someone know this one?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 2:27 am 
Regular
Regular

Joined: Fri May 12, 2006 4:05 am
Posts: 106
A SessionFactory shouldn't time out, but your database-connection most probably will...
The exception also looks like the connection was shut down form the database-side.
You should configure the idle-timeout in your connection-pool to be a bit lower than the idle-timeout defined in the DB.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 14, 2007 6:19 pm 
Beginner
Beginner

Joined: Thu May 17, 2007 2:41 pm
Posts: 48
you are right on. I set the c3p0 timeout and the app stays up all day now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.