Hi,
i have a problem with hibernate...
A Child can't be saved, because the hibernate have an error. How know what i do false.....
The Source and the Error you see in the next few lines.....
THANKS FOR EACH ANSWER
Hibernate version:
hibernate3.jar
Logfile documents:
4
4500 [RMI TCP Connection(6)-192.168.101.87] ERROR 2009-03-10 09:29:48,656 org.hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in knxathome.persistence.pojos.NavigationElement entry (don't flush the Session after an exception occurs)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:978)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:135)
at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:60)
at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1245)
at knxservice.persistence.logic.NestedSet.getTree(NestedSet.java:346)
at knxathome.persistence.rmi.RmiPersisterImpl.getTree(RmiPersisterImpl.java:312)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
44531 [RMI TCP Connection(6)-192.168.101.87] INFO 2009-03-10 09:29:48,687 knxservice.persistence.logic.VisualizationLogic - Getting parent element id for primary key: 1
Quelltext:
.....
// finally append the new child
child.setLft(parent.getLft() + (offset - 1));
child.setRgt(parent.getLft() + offset);
primaryKey = (Integer) session.save(child);//<<< error line...
// commit transaction
tx.commit();
....
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.htm