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.  [ 2 posts ] 
Author Message
 Post subject: PostgreSQL SQL Exception during buildSessionFactory()?
PostPosted: Tue Sep 02, 2003 8:37 pm 

Joined: Tue Sep 02, 2003 8:19 pm
Posts: 19

I'm using Hibernate2 on PostgreSQL7.2 for the first time (used to use MySQL), and I'm getting a very weird error:

01:33:10,001 INFO Dialect:37 - Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
01:33:10,005 INFO DriverManagerConnectionProvider:41 - Hibernate connection pool size: 20
01:33:10,008 INFO DriverManagerConnectionProvider:70 - using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost/mafo2?charSet=UNICODE
01:33:10,010 INFO DriverManagerConnectionProvider:71 - connection properties: {user=calle, password=###}
01:33:10,013 INFO SessionFactoryImpl:162 - Use outer join fetching: true
01:33:10,016 DEBUG DriverManagerConnectionProvider:77 - total checked-out connections: 0
01:33:10,019 DEBUG DriverManagerConnectionProvider:90 - opening new JDBC connection
01:33:10,047 DEBUG JDBCExceptionReporter:36 - SQL Exception
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:961)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:95)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:167)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
at de.###.DAOTransaction.<init>(Unknown Source)

Apparently this happens when DriverManagerConnectionProvider wants to set AutoCommit on the first connection. I don't quite understand why that would be a problem, though. I tried a "manual" JDBC connection to the exact same database URL with the same user and password, and it easily let me set AutoCommit to on and off (not that I would want to use that in a real application ;-)), it even let me do a query there.

But since that works, I am suspecting a problem with Hibernate - I could be completely wrong, of course.

I'm using the following XML to configure Hibernate:

<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost/mafo2?charSet=UNICODE</property>
<property name="hibernate.connection.username">calle</property>
<property name="hibernate.connection.password">###</property>

<property name="hibernate.dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>

<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.show_sql">true</property>
<!-- only some mappings snipped -->

And yes, I tried it with and without the ?charSet=UNICODE parameter ;-)

Any ideas? Do you need any more info?

 Post subject:
PostPosted: Wed Sep 03, 2003 8:49 am 

Joined: Tue Sep 02, 2003 8:19 pm
Posts: 19
I forgot: I'm using PostgreSQL 7.2, the latest JDBC driver from their website (7.3, compatible with 7.2, JDK1.3 version) and Hibernate 2.0.3.

So again: Any ideas?

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