-->
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: Postgress 7 + Hibernate 3 = ERROR
PostPosted: Thu May 12, 2005 2:36 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
Hibernate version:3

Full stack trace of any exception that occurs:
Code:
org.hibernate.exception.GenericJDBCException: Cannot open connection
   at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
   at org.hibernate.jdbc.AbstractBatcher.openConnection(AbstractBatcher.java:419)
   at org.hibernate.jdbc.JDBCContext.connect(JDBCContext.java:145)
   at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:91)
   at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:86)
   at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1096)
   at org.hibernate.loader.Loader.doQuery(Loader.java:367)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:208)
   at org.hibernate.loader.Loader.loadEntity(Loader.java:1278)
   at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:141)
   at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:126)
   at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2491)
   at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:386)
   at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:367)
   at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:166)
   at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:140)
   at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:119)
   at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:593)
   at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:59)
   at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:80)
   at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:134)
   at ru.gubber.test.domain.News$$EnhancerByCGLIB$$b14b57b9.getContent(<generated>)
   at ru.gubber.test.actions.TestAction.execute(TestAction.java:27)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
   at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
   at com.caucho.server.http.Invocation.service(Invocation.java:315)
   at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
   at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
   at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
   at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
   at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: ERROR:  SET AUTOCOMMIT TO OFF is no longer
supported

   at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
   at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482)
   at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461)
   at org.postgresql.jdbc1.AbstractJdbc1Connection.setAutoCommit(AbstractJdbc1Connection.java:953)
   at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:112)
   at org.hibernate.jdbc.AbstractBatcher.openConnection(AbstractBatcher.java:416)
   ... 34 more

Name and version of the database you are using: Postgress 7

Here is hibernate.properties next
Code:
hibernate.show_sql=false
hibernate.use_outer_join=true

hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class=org.postgresql.Driver

hibernate.connection.url=jdbc:postgresql://localhost/myDB
hibernate.connection.username=user
hibernate.connection.password=password

hibernate.connection.SelectMethod=cursor
hibernate.cglib.use_reflection_optimizer=false
hibernate.connection.pool_size=20


What should I do to solve the problem?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:24 am 
Regular
Regular

Joined: Tue Nov 23, 2004 7:42 am
Posts: 82
Location: London, England
Are you using the correct JDBC driver? Try upgrading it if you're not.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:27 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
The correctness of driver is provided by hosting owner. And I can't upgrade it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:33 am 
Regular
Regular

Joined: Tue Nov 23, 2004 7:42 am
Posts: 82
Location: London, England
I'd contact your host about it then to get some more info.

Take a look at this thread.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:40 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
And some more. Users on hosting which uese Postgress not throught Hibernate have no the problem.

The URL of site http://test.javapower.ru/test2.do. There only one action for test there. What info do you want?

May be it would be fine to contact throught e-mail (vashchenkova@mail.ru)?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:45 am 
Regular
Regular

Joined: Tue Nov 23, 2004 7:42 am
Posts: 82
Location: London, England
You need to know which version of Postgres you are using (7.what?). You also need to know which JDBC driver you are using. Is this driver appropriate for the version of Postgres you are using? If not, then you need to download a driver that is appropriate. If the driver on your host's server is incorrect then they will have to download the correct one.

HTH


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 7:34 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
There are PostgreSQL 7.4.2 and pg74.213.jdbc2ee.jar on my host's server. I don't understand anything....


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 1:46 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
May be I should tune up hibernate.properties?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 3:00 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
I found error. There was some jar-file with the Driver in classpath and first loaded driver is driver of version 7.3.
Thanx for idea!


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 3:36 am 
Regular
Regular

Joined: Tue Nov 23, 2004 7:42 am
Posts: 82
Location: London, England
Glad you got it sorted.


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.