Hibernate version:
2.1.4
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.testhibernate.pocSubscriber" table="USER">
<!-- A 32 hex character is our surrogate key. It's automatically
generated by Hibernate with the UUID pattern. -->
<id name="userID" type="java.lang.Long">
<generator class="assigned"/>
</id>
<property name="dnDFlag" type="java.lang.Boolean" column ="DND" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
pocSubscriber user1 =new pocSubscriber();
user1.setUserID(1);
user1.setDnDFlag(true);
s.save(user1);
Full stack trace of any exception that occurs:
20:51:22,203 INFO Environment:462 - Hibernate 2.1.4
20:51:22,250 INFO Environment:496 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.postgresql.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=postgres, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:postgresql://xxxxx/GMLS, hibernate.show_sql=true, hibernate.connection.password=clear, hibernate.connection.pool_size=1}
20:51:22,453 INFO Environment:521 - using java.io streams to persist binary types
20:51:22,453 INFO Environment:522 - using CGLIB reflection optimizer
20:51:22,546 INFO Configuration:347 - Mapping resource: com/testhibernate/pocSubscriber.hbm.xml
20:51:24,843 INFO Binder:229 - Mapping class: com.testhibernate.pocSubscriber -> USER
20:51:25,390 INFO Configuration:613 - processing one-to-many association mappings
20:51:25,406 INFO Configuration:622 - processing one-to-one association property references
20:51:25,406 INFO Configuration:647 - processing foreign key constraints
20:51:25,546 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
20:51:25,593 INFO SettingsFactory:58 - Maximim outer join fetch depth: 1
20:51:25,609 INFO SettingsFactory:62 - Use outer join fetching: true
20:51:25,640 INFO DriverManagerConnectionProvider:42 - Using Hibernate built-in connection pool (not for production use!)
20:51:25,640 INFO DriverManagerConnectionProvider:43 - Hibernate connection pool size: 1
20:51:25,671 INFO DriverManagerConnectionProvider:77 - using driver: org.postgresql.Driver at URL: jdbc:postgresql://192.168.6.2:3333/GMLS
20:51:25,796 INFO DriverManagerConnectionProvider:78 - connection properties: {user=postgres, password=clear}
20:51:25,890 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
20:51:26,515 INFO SettingsFactory:102 - Use scrollable result sets: true
20:51:26,515 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false
20:51:26,515 INFO SettingsFactory:108 - Optimize cache for minimal puts: false
20:51:26,515 INFO SettingsFactory:114 - echoing all SQL to stdout
20:51:26,531 INFO SettingsFactory:117 - Query language substitutions: {no='N', yes='Y'}
20:51:26,531 INFO SettingsFactory:128 - cache provider: net.sf.ehcache.hibernate.Provider
20:51:26,609 INFO Configuration:1093 - instantiating and configuring caches
20:51:28,625 INFO SessionFactoryImpl:119 - building session factory
20:51:33,359 INFO SessionFactoryObjectFactory:82 - no JNDI name configured
20:51:33,375 INFO UpdateTimestampsCache:35 - starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
20:51:33,718 WARN Plugin:95 - Could not find configuration for net.sf.hibernate.cache.UpdateTimestampsCache. Configuring using the defaultCache settings.
20:51:33,750 INFO QueryCache:39 - starting query cache at region: net.sf.hibernate.cache.QueryCache
20:51:33,750 WARN Plugin:95 - Could not find configuration for net.sf.hibernate.cache.QueryCache. Configuring using the defaultCache settings.
Hibernate: insert into USER (DND, userID) values (?, ?)
20:51:34,390 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null
20:51:34,390 ERROR JDBCExceptionReporter:46 - ERROR: parser: parse error at or near "USER" at character 13
20:51:34,406 ERROR JDBCExceptionReporter:38 - could not insert: [com.testhibernate.pocSubscriber#1]
java.sql.SQLException: ERROR: parser: parse error at or near "USER" at character 13
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1Statement.java:197)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:468)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at pocTest.main(pocTest.java:22)
20:51:34,421 ERROR SessionImpl:2375 - Could not synchronize database state with session
net.sf.hibernate.JDBCException: could not insert: [com.testhibernate.pocSubscriber#1]
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at pocTest.main(pocTest.java:22)
Caused by: java.sql.SQLException: ERROR: parser: parse error at or near "USER" at character 13
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1Statement.java:197)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:468)
... 7 more
net.sf.hibernate.JDBCException: could not insert: [com.testhibernate.pocSubscriber#1]
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at pocTest.main(pocTest.java:22)
Caused by: java.sql.SQLException: ERROR: parser: parse error at or near "USER" at character 13
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1Statement.java:197)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:468)
... 7 more
Exception in thread "main"
Name and version of the database you are using:
postgrelsql7.3.6
when i test this simple program, i was confused that No creat sql is used befor the Hibernate: insert into USER (DND, userID) values (?, ?) and when the values(?,?) i have set them. The jdbc driver report parse ERROR. I am worry and uppset about the problem,Is there anybody who can help me ,Thanks very much
|