[jboss-user] [JBoss Seam] - Re: Conversation and Manual Flush Mode

dapeng do-not-reply at jboss.com
Tue Nov 13 12:31:51 EST 2007

How will you then design your application? Get rid of the layered architecture?

anonymous wrote : You can control the flushmode both through annotations/xml and programatically through PersistenceProvider.instance().setManualFlushMode(em); You have to use a Seam Managed Persistence Context though. I would probably make the service layer set the flush mode, but then this is definitely not how I would design an application.

I chose a solution where I use an aspect to flush the persistence context after invocation of all methods with @End annotation. Any comment? I tried to do the same to switch the flush mode to manual on all methods with @Begin annotation. But this didn't work as expected. It seems that the javaassist code instrumentation overwrites or got messed up with the aspectj instrumentation. Maybe I'd better choose Seam interceptor instead of Aspectj. Only in that case I have to either reference the interceptor or an annotation based on the interceptor in all action classes. Do you have a better idea, how to solve this problem? Can I put the annotation once in an abstract super class?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104250#4104250

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104250

More information about the jboss-user mailing list