-
1. Re: cannot passivate persistence context with active transaction
deanhiller2000 Mar 4, 2010 12:33 AM (in response to kapitanpetko)We are getting this in a jboss 5.1/seam2.2.0GA configuration now. Did you find a solution? I assume if one of the servers fails, the clustering may not work for that session but it is hard to tell. I am also wondering if you have to have 2 node to get this exception as well??? I have run into some exceptions that only occur if you have both nodes of the cluster up.
-
2. Re: cannot passivate persistence context with active transaction
kapitanpetko Mar 4, 2010 8:18 AM (in response to kapitanpetko)I think I overrode the SMPC component to ignore it. This can occur even if you are not running in a cluster if your sessions passivate and you have the MEI enabled (default in 2.2?).
-
3. Re: cannot passivate persistence context with active transaction
deanhiller2000 Mar 4, 2010 4:46 PM (in response to kapitanpetko)no, I enabled the MEI myself(it is not the default). As per the docs...
If you are deploying your application in a cluster and using HTTP session replication, you must use the MEI.though I am not sure why. In our design, we have a long conversation BUT we don't dirty any beans at all during the conversation. We dirty up some serializable objects that plug into the pages and get written to and at the end of the conversation, we take data from there and write it to the beans so I would think maybe we could turn the MEI off???? and that would fix our problem.
it is hard to say. We have no Stateful/Stateless Session beans. The app can be run in tomcat(and does run in tomcat in dev). We run in jboss in QA and production. You said you overroad the SMPC to ignore it??? What do you mean here? and should I go the same route? what does it involve?
-
4. Re: cannot passivate persistence context with active transaction
asookazian Mar 9, 2010 8:05 PM (in response to kapitanpetko)from org.jboss.seam.core.Init class:
private boolean distributable = false;
So that's the default.
I just read http://docs.jboss.org/seam/2.1.2/reference/en-US/html/ClusteringAndEJBPassivation.html#d0e29850, it was pretty informative.
How bout turning off SFSB passivation altogether if you have low load?
@Nikolay: what do you mean by
overrode the SMPC component
? Do you mean the overriding the org.jboss.seam.persistence.ManagedPersistenceContext class itself? -
5. Re: cannot passivate persistence context with active transaction
kapitanpetko Mar 10, 2010 2:30 AM (in response to kapitanpetko)For some reason I'm not getting email notifications for this thread...
Arbi Sookazian wrote on Mar 09, 2010 20:05:
How bout turning off SFSB passivation altogether if you have low load?This is actually about session passivation. It could be turned off as well, though.
@Nikolay: what do you mean byoverrode the SMPC component
? Do you mean the overriding the org.jboss.seam.persistence.ManagedPersistenceContext class itself?Yes.
-
6. Re: cannot passivate persistence context with active transaction
deanhiller2000 Apr 12, 2010 5:19 PM (in response to kapitanpetko)Well, I cam full circle on this one. We have pretty decent load on our servers, but I would like to know how to
1. How to override ManagedPersistenceContext? (I know I could probably put the same class name on the classpath before the seam one is picked up, but would like a better way so I can subclass what is there)
2. How to turn off session passivation?
3. Lastly, what are the affects of turning off session passivation? would that be bad?thanks,
Dean -
7. Re: cannot passivate persistence context with active transaction
asookazian Apr 12, 2010 9:52 PM (in response to kapitanpetko)http://www.jboss.org/ejb3/docs/reference/build/reference/en/html/session-bean-config.html
Sometimes it is useful to turn off passivation entirely. This can be done by plugging in the caching implementation using the @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class) annotation.Read this as well: http://community.jboss.org/wiki/Ejb3DisableSfsbPassivation.pdf
-
8. Re: cannot passivate persistence context with active transaction
deanhiller2000 Apr 12, 2010 11:28 PM (in response to kapitanpetko)I am not using any stateless/stateful beans though. We thought there was way too much duplication of code going that route. Seemed overkill.
I did see the the MEI is simpling throwing an exception that the caller just swallows so this exception is just noise so now my preferred route is to override the MEI specifically ManagedPersistenceContext. How do I override that class? It has no Name annotation but when I startup, it's name appears to be entityManager in the logs and there is an Unwrap annotation on one of the methods were it gets the EntityManager from I guess. How do I override this class?
thanks,
Dean -
9. Re: cannot passivate persistence context with active transaction
asookazian Apr 12, 2010 11:37 PM (in response to kapitanpetko)You will have to modify the Seam core source code (ManagedPersistenceContext.java) and then build the core classes using ant/maven, etc.
Why do you need to do this?
What does MEI stand for?
-
10. Re: cannot passivate persistence context with active transaction
kapitanpetko Apr 13, 2010 3:47 AM (in response to kapitanpetko)
Arbi Sookazian wrote on Apr 12, 2010 23:37:
You will have to modify the Seam core source code (ManagedPersistenceContext.java) and then build the core classes using ant/maven, etc.No. Override the usual way, that it has no @Name doesn't matter. The name is supplied in your components.xml. So simply:
@Scope(ScopeType.CONVERSATION) @BypassInterceptors @Install(precedence = Install.APPLICATION, value = false) public class MyeManagedPersistenceContext extends ManagedPersistenceContext {
MEI: Managed Entity Interceptor (Cf. 35.2. EJB Passivation and the ManagedEntityInterceptor)
Re HTTP session passivation: http://community.jboss.org/wiki/DistributableHttpSessionPassivation
The effects of turning it off: higher memory usage for sure, not sure of other side effects.
HTH
-
11. Re: cannot passivate persistence context with active transaction
iceve Apr 13, 2010 1:01 PM (in response to kapitanpetko)thx, i need this two..
but i think we still need reconfig components.xml.
i saw persistence:managed-persistence-context means org.jboss.seam.persistence.ManagedPersistenceContext.
so how can we write our new MyeManagedPersistenceContext there?
-
12. Re: cannot passivate persistence context with active transaction
kapitanpetko Apr 14, 2010 3:35 AM (in response to kapitanpetko)
Li Jihua wrote on Apr 13, 2010 13:01:
so how can we write our new MyeManagedPersistenceContext there?The usual way:
<component name="entityManager" auto-create="true" precedence="20" class="mypackage.MyManagedPersitenceContext".../>
persistence:managed-persistence-context just saves you some typing, it means the same thing.
HTH
-
13. Re: cannot passivate persistence context with active transaction
iceve Apr 14, 2010 4:58 PM (in response to kapitanpetko)
Nikolay Elenkov wrote on Apr 14, 2010 03:35:
Li Jihua wrote on Apr 13, 2010 13:01:
so how can we write our new MyeManagedPersistenceContext there?
The usual way:<component name="entityManager" auto-create="true" precedence="20" class="mypackage.MyManagedPersitenceContext".../>
persistence:managed-persistence-context just saves you some typing, it means the same thing.
HTHgotcha. very very thx...