Dear all,
I have a problem with hibernate objects which are not syncronized with the underlying database record within a running transaction.
The tricky part is, that certain fields are set in the database using an insert trigger, and I need to get these values into my hibernate business object before it is commited.
To illustrate, I have the following scenario:
{tx start by SpringHibernateTransactionManager}
-crate a new empty OrderBasket business object -set some attributes on the OrderBasket -call getHibernateTemplate().saveOrUpdate(orderBasket); -call getHibernateTemplate().flush(); -call getHibernateTemplate().findByNamedQuery("OrderBask et.findByUniqueId");
here we see, that the update date is not set on the business object.
{tx commit by SpringHibernateTransactionManager}
Even if I call OrderBasket getHibernateTemplate().refresh(orderBasket), it does not help. In this case, I get an exception as follows: "could not load an entity".
Can anybody give me a hint on where I have to look into?
Thank you for any help.
Christoph
|