[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-369) @Create and @Begin(FlushModeType.MANUAL) execute in wrong order
Christian Bauer (JIRA)
jira-events at jboss.com
Wed Nov 15 06:35:41 EST 2006
[ http://jira.jboss.com/jira/browse/JBSEAM-369?page=all ]
Christian Bauer updated JBSEAM-369:
-----------------------------------
Affects Version/s: 1.1.0.BETA2
Priority: Minor (was: Blocker)
I found out what was wrong:
@Name("testtwo")
@Stateful
public class TestTwoBean implements TestTwo {
@In(value = "seamdemoEM", create = true)
private EntityManager em;
@Begin(flushMode = FlushModeType.MANUAL)
public void start() {
System.out.println("### START: " + ((Session)em.getDelegate()).getFlushMode());
Item item = new Item("foo", "bar");
em.persist(item);
}
public void step() {
System.out.println("### STEP: " + ((Session)em.getDelegate()).getFlushMode());
em.flush();
}
@End @Remove @Destroy
public void destroy() {
System.out.println("### DESTROY: " + ((Session)em.getDelegate()).getFlushMode());
}
}
The START prints FlushMode.AUTO, but the PC is in fact not flushed. So basically my test is wrong, because in STEP I see FlushMode.NEVER and the conversation is atomic as expected.
I'm leaving this issue open (downgraded severity), because I still think that there is a minor bug there somewhere.
> @Create and @Begin(FlushModeType.MANUAL) execute in wrong order
> ---------------------------------------------------------------
>
> Key: JBSEAM-369
> URL: http://jira.jboss.com/jira/browse/JBSEAM-369
> Project: JBoss Seam
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.0.BETA2
> Reporter: Christian Bauer
> Assigned To: Gavin King
> Priority: Minor
> Fix For: 1.1.0.CR1
>
>
> This is CVS HEAD:
> @Name("catalog")
> @Stateful
> public class CatalogBean implements Catalog {
> @In(value = "caveatEmptorEM", create = true)
> private EntityManager em;
> @Create
> @Begin(flushMode = FlushModeType.MANUAL)
> public void refreshRootCategories() {
> ...
> }
> The EntityManager is in FlushMode.AUTO because it is injected before the ConversationInterceptor runs and reads the @Begin annotation.
> So ManagedPersistenceContext.create() runs and sets the flush mode before the setFlushMode() method on the Conversation component is called.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list