Hibernate version:3.2
I have two objects A (parent) , B (child)
Mapping documents:
A:
<class name="A" table="A" lazy="true"
batch-size="6">
<id name="id" column="ID">
<generator class="increment"/>
</id>
<property name="name" column="NAME" not-null="true"/>
<set name="b" cascade="none" lazy="false" inverse="true">
<key column="a_id"/>
<one-to-many class="B" />
</set>
</class>
B:
<class name="B" table="B" lazy="true"
batch-size="6">
<id name="id" column="ID">
<generator class="increment"/>
</id>
<property name="name" column="NAME" not-null="true"/>
<many-to-one name="a" column="a_id"
class="A" cascade="none" lazy="false"/>
</class>
Code between sessionFactory.openSession() and session.close(): b.saveOrUpdate(); b.commit();
Full stack trace of any exception that occurs: 07/06/15 12:24:23 Hibernate: update B set NAME=?, A_ID=? where ID=?
07/06/15 12:24:23 [WARN] JDBCExceptionReporter - -SQL Error: 1722, SQLState: 42000
07/06/15 12:24:23 [ERROR] JDBCExceptionReporter - -ORA-01722: invalid number
07/06/15 12:24:23 [WARN] JDBCExceptionReporter - -SQL Error: 1722, SQLState: 42000
07/06/15 12:24:23 [ERROR] JDBCExceptionReporter - -ORA-01722: invalid number
07/06/15 12:24:23 [ERROR] AbstractFlushingEventListener - -Could not synchronize database state with session <org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update>org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at baseline.BAction.execute(BaselineAction.java:95)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.BatchUpdateException: ORA-01722: invalid number
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:380)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8757)
at com.evermind.sql.FilterStatement.executeBatch(FilterStatement.java:413)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 23 more
07/06/15 12:24:23 [WARN] RequestProcessor - -Unhandled Exception thrown: class org.hibernate.exception.SQLGrammarException
I am not able to find why invalid number exception is being thrown
When I try to debug, at commit it tries to set every property of the object but in the joining column it comes up with a weird number of Long type and tries to set it and then throws the error.
Is there somebody who can help.........?????
|