Fairly new at Hibernate, sorries.
Weird problem,
So far my logs tell me everything's working fine, and my new OrderPlaced and Invoice are committed to the database properly and the method ends.
The Invoice is coupled to the OrderPlaced via: OrderPlaced.invoice_id and Invoice.orderPlaced_id.
Then Hibernate suddenly comes with a:
Code:
2010-02-01 16:00:35,420 DEBUG [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
2010-02-01 16:00:35,437 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2010-02-01 16:00:35,489 DEBUG [org.hibernate.jdbc.ConnectionManager] skipping aggressive-release due to flush cycle
2010-02-01 16:00:35,507 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
2010-02-01 16:00:35,507 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2010-02-01 16:00:35,509 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
2010-02-01 16:00:35,509 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [Invoice], timestamp: 5181589239844864
2010-02-01 16:00:35,510 DEBUG [nl.isaac.youw8.web.bean.OrderBean] end doOrder [b][taht's the end of my method][/b]
2010-02-01 16:00:35,512 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
2010-02-01 16:00:35,517 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
...
2010-02-01 16:00:35,601 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 insertions, 2 updates, 0 deletions to 48 objects
2010-02-01 16:00:35,602 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 3 updates, 0 removals to 94 collections
2010-02-01 16:00:35,602 DEBUG [org.hibernate.pretty.Printer] listing entities:
...
2010-02-01 16:00:35,653 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Pre-invalidating space [OrderPlaced]
2010-02-01 16:00:35,654 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2010-02-01 16:00:35,654 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2010-02-01 16:00:35,654 DEBUG [org.hibernate.SQL]
/* update
nl.isaac.youw8.ejb.orderPlaced.OrderPlaced */ update
OrderPlaced
set
date=?,
currency_id=?,
status=?,
remark=?,
customerBilling_id=?,
customerShipping_id=?,
paymentMethod_id=?,
ordernumber=?,
loggedInUser_id=?,
invoice_id=?,
affiliateLabel_id=?,
paymentMethodNumber=?,
price=?,
matsCode=?,
deliveryCost=?
where
id=?
And in the update statement it turns the invoice_id back to null.
Now my Invoice is orphaned, isn't it?
Can someone tell me what Hibernate is trying to do here?