[jboss-cvs] JBossAS SVN: r77541 - projects/ejb3/trunk/transactions/src/main/java/org/jboss/ejb3/tx.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 27 11:12:48 EDT 2008
Author: wolfc
Date: 2008-08-27 11:12:48 -0400 (Wed, 27 Aug 2008)
New Revision: 77541
Modified:
projects/ejb3/trunk/transactions/src/main/java/org/jboss/ejb3/tx/TxUtil.java
Log:
EJBTHREE-1476: fixed hack
Modified: projects/ejb3/trunk/transactions/src/main/java/org/jboss/ejb3/tx/TxUtil.java
===================================================================
--- projects/ejb3/trunk/transactions/src/main/java/org/jboss/ejb3/tx/TxUtil.java 2008-08-27 15:09:02 UTC (rev 77540)
+++ projects/ejb3/trunk/transactions/src/main/java/org/jboss/ejb3/tx/TxUtil.java 2008-08-27 15:12:48 UTC (rev 77541)
@@ -156,15 +156,11 @@
{
Invocation invocation = CurrentInvocation.getCurrentInvocation();
- // TODO: these checks are real ugly
- // getUserTransaction is not allowed during construction and injection EJB 3 4.4.1 and EJB 3 4.5.2
- // We're constructing the bean
- if(invocation == null)
- throw new IllegalStateException("It's not allowed to get the UserTransaction during construction and injection " + ctx);
- // Is construction happening from within another bean?
- if(ctx.getInstance() != invocation.getTargetObject())
- throw new IllegalStateException("It's not allowed to get the UserTransaction during construction and injection " + ctx);
+ // TODO: also not allowed during construction
+ if(InvocationHelper.isInjection(invocation))
+ throw new IllegalStateException("getUserTransaction() not allowed during injection (EJB3 4.4.1 & 4.5.2)");
+
Advisor advisor = invocation.getAdvisor();
TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
if (type != TransactionManagementType.BEAN) throw new IllegalStateException("Container " + advisor.getName() + ": it is illegal to inject UserTransaction into a CMT bean");
More information about the jboss-cvs-commits
mailing list