Issue Type: Bug Bug
Assignee: Unassigned
Created: 14/May/13 4:16 AM
Description:

I want to configure hibernate with SybaseIQ.
I am able to connect it with proper configuration,but when i am trying to add the record using parent-child relationship i am getting org.hibernate.NonUniqueObjectException exception.
I think it is related to identity as the primary key values are not getting updated by db.

This is my error logs.

Hibernate: insert into TB_TRBA_XML (FILE_PATH) values
select @@identity
Hibernate: insert into TB_XML_XPATH (XML_XPATH) values
select @@identity
Hibernate: insert into TB_XML_XPATH_MAPPING (XML_ID, XPATH_ID) values (?, ?)
org.hibernate.exception.GenericJDBCException: could not insert collection: com.iris.etl.database.pojo.TbTrbaXml.tbXmlXpaths#8
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1205)
at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:58)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:171)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at com.iris.etl.database.session.HibernateOperation.add(HibernateOperation.java:118)
at com.iris.dummy.DatabaseTesting.main(DatabaseTesting.java:37)
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -1000293: Cannot insert or update Column XML_ID: set option 'identity_insert' to the specific table name containing the identity column to be modified.
– (optlib\opt_DML.cxx 4656)
at com.sybase.jdbc3.tds.Tds.processEed(Tds.java:3069)
at com.sybase.jdbc3.tds.Tds.nextResult(Tds.java:2373)
at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:220)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:203)
at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(SybStatement.java:1811)
at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(SybStatement.java:1794)
at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java:116)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1168)
... 11 more

Project: Hibernate ORM
Priority: Major Major
Reporter: Anup Rana
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira