I'm using *OpenJPA 2.1.1* with *Postgres 9.1*. My persistence.xml file contains the following parameters :
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction=add,ForeignKeys=true)" /> <property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=200" /> <property name="openjpa.jdbc.DBDictionary" value="postgres(SearchStringEscape=\)"/> I got a ReportingSQLException when JPA tries to get the name of a sequence to define the identity of my entity bean. *Exception stack trace* 2012-06-04 23:09:24,038 WARN [JDBC] Unable to determine which sequences are owned by the database. OpenJPA will consider all sequences suffixed with "_seq" as database managed. This may result in improper creation or removal of sequences with this suffix. The original PostgreSQL driver exception is being logged for your reference. org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block {prepstmnt 155836080 SELECT pg_get_serial_sequence(?, ?) [params=?, ?]} [code=0, state=25P02] at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:281) at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:257) at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:72) at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.execute(LoggingConnectionDecorator.java:1295) at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:386) at org.apache.openjpa.jdbc.sql.PostgresDictionary.queryOwnership(PostgresDictionary.java:467) at org.apache.openjpa.jdbc.sql.PostgresDictionary.isOwnedSequence(PostgresDictionary.java:441) at org.apache.openjpa.jdbc.sql.PostgresDictionary.isSystemSequence(PostgresDictionary.java:409) at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSequences(SchemaGenerator.java:960) at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchema(SchemaGenerator.java:367) at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchemas(SchemaGenerator.java:300) at org.apache.openjpa.jdbc.schema.SchemaTool.getDBSchemaGroup(SchemaTool.java:1163) at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:363) at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:340) at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:505) at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:456) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:160) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:164) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:122) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:210) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60) at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createEntityManager(CMPEntityManagerTxScoped.java:77) at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getEntityManager(CMPEntityManagerTxScoped.java:58) at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createNamedQuery(CMPEntityManagerTxScoped.java:419) ...... Thanks in advance -- View this message in context: http://openjpa.208410.n2.nabble.com/PostgreSQL-9-1-tp7580208.html Sent from the OpenJPA Users mailing list archive at Nabble.com.