]
Pete Muir updated JBSEAM-1678:
------------------------------
Fix Version/s: The future
(was: 2.1.0.GA)
Defer, this is too big a change to consider in the 2.1 timeframe.
@Begin(flushMode=MANUAL) takes effect AFTER method call instead of
before it.
-----------------------------------------------------------------------------
Key: JBSEAM-1678
URL:
https://jira.jboss.org/jira/browse/JBSEAM-1678
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Environment: J2SE 1.5, Tomcat 6.0.10, Hibernate 3.2.3, HibEM 3.3.1
Reporter: Frits Jalvingh
Fix For: The future
Original Estimate: 1 hour
Remaining Estimate: 1 hour
(See also the end of thead at
http://jboss.com/index.html?module=bb&op=viewtopic&p=4064502#4064502)
I have a method marked:
@Begin(flushMode=FlushModeType.MANUAL)
public String createNewTarget()
This method is meant as the start of a 2-screen conversation. This conversation should be
rolled back if a user presses cancel so flushmode=MANUAL is used to prevent the
persistence context from flushing db changes.
The method starts by creating a new entity and persist()s it. The problem is that this
causes an immediate "insert" by Hibernate regardless of the flushmode.
I debugged the code and found that the flushmode gets set AFTER Seam calls the method,
not before (ConversationInterceptor). This seems to be wrong, so I placed an extra call to
set the mode in aroundInvoke():
setFlushMode(method); // JAL FlushMode should be set BEFORE we call the
method!?
Object result = invocation.proceed();
beginConversationIfNecessary(method, result);
endConversationIfNecessary(method, result);
return result;
(flushMode in the original code is set in beginConversation()).
This at least fixes part of the problem; the other part of the problem is a bug in
Hibernate where it always forces an insert even if it is not needed. I fixed that too
which fixes the entire problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: