-
1. Re: contradicting constraints and statements issue order
sethladd Nov 28, 2005 9:47 PM (in response to ebu)Hi,
Did you ever find a solution to this? We need our delete statements to be flushed before our insert statements (in other words, in the order that we execute the methods that result in the statements), and we really don't want to put Session calls inside our domain objects.
Thanks!
Seth -
2. Re: contradicting constraints and statements issue order
gavin.king Nov 28, 2005 9:54 PM (in response to ebu)Manually call flush() in between the call to remove() and the call to persist().
-
3. Re: contradicting constraints and statements issue order
ebu Nov 29, 2005 4:39 AM (in response to ebu)Hi.
Unfortunately i come up with calling flush as suggested by gavin. Thus this forces me either to call entity manager from an entity bean or move domain logic into the service. I've chosen the first.
wbr, eugen. -
4. Re: contradicting constraints and statements issue order
sethladd Nov 29, 2005 1:19 PM (in response to ebu)Thanks. We really want to avoid putting any calls to the EntityManager inside our domain objects. For the time being, we've split up the deletes and adds into two different methods, and called them from the service bean. deleteThem(), flush(), addThem(). Ugly, but it works.
After thinking about it, we could enable immediate flushing for this service method only.