-
1. Re: Seam Transaction is not active: tx=TransactionImple
gonorrhea May 1, 2009 9:47 PM (in response to oyesiji77)I have seen this happen several times in multiple Seam 2.0.x apps. I have never been able to identify the root cause. There is a JBoss wiki related to this but not very helpful (at least not in a Seam/EJB3/JPA context):
http://www.jboss.org/auth/wiki/TxNotActive?action=e&windowstate=normal&mode=view
jboss-service.xml (default):
<mbean code="org.jboss.tm.TransactionManagerService" name="jboss:service=TransactionManager" xmbean-dd="resource:xmdesc/TransactionManagerService-xmbean.xml"> <attribute name="TransactionTimeout">300</attribute> <!- - set to false to disable transaction demarcation over IIOP - -> <attribute name="GlobalIdsEnabled">true</attribute> <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends> <!- - Transaction Integrity Checking - -> <!- - Force a rollback if another thread is associated with the transaction at commit - -> <!- - <depends optional-attribute-name="TransactionIntegrityFactory" proxy-type="org.jboss.tm.integrity.TransactionIntegrityFactory"> <mbean code="org.jboss.tm.integrity.FailIncompleteTransaction" name="jboss:service=TransactionManager,plugin=TransactionIntegrity"/> </depends> - -> </mbean>
It's possible that this exception is tx timeout related. However, 300 secs is 5 mins. In my use cases, I have not experienced any hanging that long during testing. Also, it seems after some searching on JBoss Transactions forum, that it occurs in multi-thread and single-user scenarios.
@Seam devs: plz address this problem and help identify root cause and fix and post sticky, etc. The exception verbage is extremely user unfriendly. Yes, this exception is most likely not Seam-specific, but I'm sure a lot of Seam devs using the EAP (JBoss stack) are running into this
mind-bender
. thx. -
2. Re: Seam Transaction is not active: tx=TransactionImple
gonorrhea May 1, 2009 10:02 PM (in response to oyesiji77)The following link in JBoss transactions forum is helpful:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=124299
Mark Little:
So Hibernate is setting the transaction to rollback only. This could be a MySQL issue: we've seen issues in other projects with MySQL running on Linux producing failures that do not show up on Windows or other OS-es. Maybe you can shift to a different database?In my case, we're using Windows OS with MSSQL 2005 RDBMS.
Here is a related referenced thread:
https://forum.hibernate.org/viewtopic.php?p=2369722
I'm wondering if it has to do with too many open connections. And if so, whether or not enabling Hibernate live statistics (getSummary()) would help troubleshoot this.
Has anybody successfully performed root cause analysis on this problem? And what exactly does that arcane exception mean?
Transaction is not active: tx=TransactionImple < ac
?
this seems so cryptic, kinda like translating hieroglyphics.
I'm dying to understand this problem as it comes and goes quite often.
-
3. Re: Seam Transaction is not active: tx=TransactionImple
gonorrhea May 1, 2009 10:04 PM (in response to oyesiji77)have you tried marking your findAll() method with @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) to see how it behaves? IIRC, the exception is not reproducible with NOT_SUPPORTED...
-
4. Re: Seam Transaction is not active: tx=TransactionImple
gonorrhea May 1, 2009 10:12 PM (in response to oyesiji77)here is another relevant link I posted on hibernate.org forum last month (so we can view some code as well):
https://forum.hibernate.org/viewtopic.php?f=1&t=995754&p=2409096
-
5. Re: Seam Transaction is not active: tx=TransactionImple
oyesiji77 May 1, 2009 10:53 PM (in response to oyesiji77)Can this be a MySQL problem, Because i am using Mysql. The strange thing is that this happens whenever i invoke the method the first time
-
6. Re: Seam Transaction is not active: tx=TransactionImple
oyesiji77 May 1, 2009 10:57 PM (in response to oyesiji77)Tried using NOT_SUPPORTED, still does not work
-
7. Re: Seam Transaction is not active: tx=TransactionImple
gonorrhea May 1, 2009 11:05 PM (in response to oyesiji77)How bout marking all (public) business methods with NOT_SUPPORTED? Ultimately, you don't want to keep your methods demarcated as such but it may help in terms of trouble-shooting.
-
8. Re: Seam Transaction is not active: tx=TransactionImple
thatproblemguy Jun 18, 2009 10:52 PM (in response to oyesiji77)Whatever happened with this? We are having the same problem on a query that takes a little bit (10 seconds) to return.
-
9. Re: Seam Transaction is not active: tx=TransactionImple
oyesiji77 Jun 18, 2009 11:01 PM (in response to oyesiji77)I don't know if this has to do with the type and version of JVM being used because i noticed that when i switched from windows to MAC , I have never experienced the problem again
NB:Not suggesting that MAC is better than windows
-
10. Re: Seam Transaction is not active: tx=TransactionImple
serginho Jun 26, 2009 1:00 AM (in response to oyesiji77)maybe its something about your datasource, ... are you working with multiple databases??
-
11. Re: Seam Transaction is not active: tx=TransactionImple
swd847 Jun 26, 2009 1:10 AM (in response to oyesiji77)@In EntityManager entityManager; and @TransactionAttribute(REQUIRES_NEW) are not compatible. This MAY be the root cause, but I am not sure. Try using either @PersistenceContext or @TransactionAttribute(REQUIRED) and make sure you have <transaction:ejb-transaction/> installed in components.xml. -
12. Re: Seam Transaction is not active: tx=TransactionImple
asookazian Jun 26, 2009 9:55 PM (in response to oyesiji77)
Stuart Douglas wrote on Jun 26, 2009 01:10:
@In EntityManager entityManager; and @TransactionAttribute(REQUIRES_NEW) are not compatible.where is this documented? why? Never heard that before...
-
13. Re: Seam Transaction is not active: tx=TransactionImple
asookazian Jul 24, 2009 11:02 PM (in response to oyesiji77)I just disproved your statement above regarding @In and REQUIRES_NEW are not
compatible
. I am getting no exceptions with the code below and the data is being output to the server.log accordingly while iterating thru the Lists. Can someone please verify my finding? REQUIRES_NEW is not available when using Seam's @Transactional. Why? This seems like a disadvantage to using Seam tx mgmgt vs. EJB CMT...@Name("testRequiresNew") @Startup @Scope(ScopeType.APPLICATION) @Stateful public class TestRequiresNewAction implements TestRequiresNew { @In private EntityManager entityManager; @In private TestRequiresNewAction testRequiresNew; @Logger private Log log; @Remove public void destroy() { log.info("TestRequiresNewAction: in destroy()"); } @Create @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) //@TransactionAttribute(TransactionAttributeType.REQUIRED) public void test1() { log.info("TestRequiresNewAction: in test1()"); List<ApplicationSetting> list = entityManager.createQuery("from ApplicationSetting").getResultList(); for (ApplicationSetting as : list) { log.info("as.getAddedDate() = "+as.getAddedDate()); } testRequiresNew.test2(); } @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public void test2() { log.info("TestRequiresNewAction: in test2()"); List<ApplicationSite> list = entityManager.createQuery("from ApplicationSite").getResultList(); for (ApplicationSite as : list) { log.info("as.getAddedDate() = "+as.getAddedDate()); } } }
-
14. Re: Seam Transaction is not active: tx=TransactionImple
swd847 Jul 25, 2009 12:26 AM (in response to oyesiji77)I did not say you would get an exception. When using REQUIRES_NEW the SMPC will not get enlisted into the new transaction. To quote from the seam docs:
If you are using EJB3 and mark your class or method @TransactionAttribute(REQUIRES_NEW) then the transaction and persistence context shouldn't be propagated to method calls on this object. However as the Seam-managed persistence context is propagated to any component within the conversation, it will be propagated to methods marked REQUIRES_NEW. Therefore, if you mark a method REQUIRES_NEW then you should access the entity manager using @PersistenceContext.