-->
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.  [ 10 posts ] 
Author Message
 Post subject: Connection management problem (hibernate2.1.2/Sybase12.5)
PostPosted: Thu Apr 29, 2004 4:32 am 
Newbie

Joined: Thu Apr 29, 2004 4:27 am
Posts: 5
Hi !
We work with hibernate, using a Sybase 12.5 database and a Proxool connection pool.
We started working with hibernate 2.1.1, and I tried an upgrade to the 2.1.3 version yesterday.
Unforntunately, a problem has appeared. I get the following warning message (I tried with 2.1.2 version, and I get the exactly the same) :


09:45:35,013 WARN org.logicalcobwebs.proxool.hibernate-1 - #59 - Problem calling connection.commit() or connection.setAutoCommit(true)

com.sybase.jdbc2.jdbc.SybSQLException: SET CHAINED command not allowed within multi-statement transaction.


at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2636)

at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1996)

at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)

at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:204)

at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:187)

at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1615)

at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:1598)

at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java:89)

at com.sybase.jdbc2.tds.Tds.setOption(Tds.java:1111)

at com.sybase.jdbc2.jdbc.SybConnection.setAutoCommit(SybConnection.java:634)

at org.logicalcobwebs.proxool.ConnectionResetter.reset(ConnectionResetter.java:282)

at org.logicalcobwebs.proxool.ConnectionPool.resetConnection(ConnectionPool.java:905)

at org.logicalcobwebs.proxool.AbstractProxyConnection.close(AbstractProxyConnection.java:218)

at org.logicalcobwebs.proxool.ProxyConnection.invoke(ProxyConnection.java:55)

at org.logicalcobwebs.cglib.proxy.Proxy$ProxyImpl$$EnhancerByCGLIB$$fcb7ae55.close(<generated>)

at net.sf.hibernate.connection.ProxoolConnectionProvider.closeConnection(ProxoolConnectionProvider.java:74)

at net.sf.hibernate.impl.BatcherImpl.closeConnection(BatcherImpl.java:297)

at net.sf.hibernate.impl.SessionImpl.disconnect(SessionImpl.java:3343)

at net.sf.hibernate.impl.SessionImpl.close(SessionImpl.java:563)

at sg.sprint.core.logic.ServiceAdapter.closeSession(ServiceAdapter.java:278)

at sg.sprint.core.logic.ServiceAdapter.findAll(ServiceAdapter.java:126)

at sg.sprint.core.logic.common.CommonServiceImpl.findAllCurrencies(CommonServiceImpl.java:388)

at sg.sprint.webapp.component.CurrencyList.initContent(CurrencyList.java:25)

at sg.sprint.webapp.fwk.taglib.ComponentTagAdapter.doEndTag(ComponentTagAdapter.java:72)

at org.apache.jsp.updateActualDataRecord_jsp._jspx_meth_sprint_list_1(updateActualDataRecord_jsp.java:1815)

at org.apache.jsp.updateActualDataRecord_jsp._jspService(updateActualDataRecord_jsp.java:373)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)

at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)

at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)

at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:822)

at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:398)

at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)

at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)

at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)

at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)

at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)

at org.apache.jsp.standardLayout_jsp._jspx_meth_tiles_insert_2(standardLayout_jsp.java:144)

at org.apache.jsp.standardLayout_jsp._jspService(standardLayout_jsp.java:72)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)

at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)

at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254)

at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)

at java.lang.Thread.run(Thread.java:534)

09:45:35,033 WARN org.logicalcobwebs.proxool.hibernate-1 - #59 - There were some problems resetting the connection (see debug output for details). It will not be used again (just in case). The thread that is responsible is named 'TP-Processor8'

09:45:35,033 WARN org.logicalcobwebs.proxool.hibernate-1 - #59 - The connection was closed with autoCommit=false. That is fine, but it might indicate that the problems that happened whilst trying to reset it were because a transaction is still in progress.

09:45:35,073 WARN org.logicalcobwebs.proxool.hibernate-1 - Unable to set status of connection 59 from ACTIVEto AVAILABLE. It remains NULL


Does anyone have the same problem ???

Laurent


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 30, 2004 12:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Search the forum. I think this has already been discussed.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 01, 2004 7:38 am 
Newbie

Joined: Thu Apr 29, 2004 4:27 am
Posts: 5
Sorry I searched the forum before posting, but I didn't find anything about this problem...
There are some threads about CHAINED MODE with Sybase, but nothing matches with the problem I have...


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 28, 2004 5:28 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Here is what I understand from your stack trace:

1/ Your hibernate session is being closed or disconnected;
2/ So Hibernate closes the jdbc connection;
3/ closing the connection returns it to the pool;
4/ when the connection is returned, Proxool resets it to the state it had when it was created. In this process, it restes the autoCommit flag to its initial value - which in your case was TRUE.

Setting the autoCommit to TRUE *may* cause all previous actions to be committed if any.

I was wondering if your problem is not caused by your transaction not being committed before you close the session. Or may be you made some other actions after the transaction has been rolledback ?

Just my two cents...


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 30, 2004 12:22 pm 
Newbie

Joined: Thu Apr 29, 2004 4:27 am
Posts: 5
That's aproximately what I understood about the stack I get !

In fact I get this exception each time I close a session, even if no transaction was opened during its lifetime, in fact it happens even if the session was only used for read operations...
Maybe we have a bad setting somewhere (autocommit=true for example...)

But in fact I didn't search very long and I went back to the hibernate 2.1 version, with which I don't get this exception !

Maybe we will have time later to look to this problem !

Thanks for your answer !

Laurent


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 30, 2004 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
ALWAYS USE TRANSACTIONS. I'm not sure how many times we have to say this.....


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 31, 2004 6:29 am 
Newbie

Joined: Thu Apr 29, 2004 4:27 am
Posts: 5
Yes I know !
I always use transactions if session performs write operations.

I was just saying that this error occurs every time I close a session, even if this session only performed read operations (it's only in this case that I don't use transaction of course !)

Laurent


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 31, 2004 7:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Of course you should use transactions when doing reads, too. This has been discussed about 20 times already here.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 31, 2004 12:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
What part of the word "always" do you not understand ;)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 31, 2004 1:32 pm 
Newbie

Joined: Thu Apr 29, 2004 4:27 am
Posts: 5
OK, sorry I missed this point !
I didn't read lots of threads in the forum, so I did never read about this !
Well I will search more about this in the forum !

Laurent


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 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.