[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-434) SQLException: ORA-02287 while fetching the sequence value
Petr H (JIRA)
noreply at atlassian.com
Wed Jul 8 08:44:12 EDT 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33567#action_33567 ]
Petr H commented on EJB-434:
----------------------------
This is cause by the change in the SQl statement used. Prior to version 3.4.0 the statement had the following form:
SELECT SEQ_XXX.NEXTVAL FROM DUAL
but is has changed in the current release to:
select * from ( SELECT SEQ_XXX.NEXTVAL FROM DUAL ) where rownum <= ?
which is incorrect for Oracle Database
On JBoss AS 5.1.0 where it's used by default we switched from:
hibernate-3.3.1.ga.jar
hibernate-annotations-3.4.0.ga.jar
hibernate-commons-annotations-3.1.0.ga.jar
hibernate-entitymanager-3.4.0.ga.jar
hibernate-validator-3.1.0.ga.jar
to:
hibernate-3.2.6.ga.jar
hibernate-annotations-3.3.0.ga.jar
hibernate-commons-annotations-3.0.0.ga.jar
hibernate-entitymanager-3.3.1.ga.jar
hibernate-validator-3.0.0.ga.jar
in order to make things working quite reliably.
> SQLException: ORA-02287 while fetching the sequence value
> ----------------------------------------------------------
>
> Key: EJB-434
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-434
> Project: Hibernate Entity Manager
> Issue Type: Bug
> Components: EntityManager
> Affects Versions: 3.4.0.GA
> Environment: 3.4.0.GA, Oracle 10g
> Reporter: Jerish Joseph
>
> We are getting ORA-02287 error while fetching the sequence value from database. The query executed is SELECT APP_SEQ.NEXTVAL FROM DUAL. We reveretd to an old version of hibernate-entitymanager (3.2.1.ga ) to get rid of this issue.
> The exception thrown with 3.4.0.GA is:
> Caused by: java.sql.SQLException: ORA-02287: sequence number not allowed here
> at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
> at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
> at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
> at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
> at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
> at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
> at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
> at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
> at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
> at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
> at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteQuery(WSJdbcPreparedStatement.java:1011)
> at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:661)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
> at org.hibernate.loader.Loader.doQuery(Loader.java:697)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
> at org.hibernate.loader.Loader.doList(Loader.java:2228)
> ... 196 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list