users@glassfish.java.net

RE: UserTransaction lookup failed.

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Thu, 20 Aug 2009 10:30:27 -0400

if spanning multiple resources then implement JtaTransactionManager and lookup with GF using
"java:appserver/TransactionManager"
if your beans method annotates with REQUIRED,SUPPORTS,MANDATORY or NEVER
@TransactionalAttribute(TransactionAttributeType.REQUIRED)
@TransactionalAttribute(TransactionAttributeType.SUPPORTS)
@TransactionalAttribute(TransactionAttributeType.MANDATORY)
@TransactionalAttribute(TransactionAttributeType.NEVER)
a lookup with UserTransaction would work
"java:comp/UserTransaction"

but if your TransactionAttribute is
REQUIRES_NEW, NOT_SUPPORTED
@TransactionalAttribute(TransactionAttributeType.REQUIRES)
@TransactionalAttribute(TransactionAttributeType.NOT_SUPPORTED)
then
a lookup with AppServer will work
"java:appserver/TransactionManager"

http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/transaction/jta/JtaTransactionManager.html

Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Thu, 20 Aug 2009 06:46:44 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: Re: UserTransaction lookup failed.
>
> Also,
>
> when I hack the code to lookup without the java:comp namespace
>
> I get another exception which comes from the actual UserTransaction implementation.
>
> Caused by: java.lang.IllegalStateException: Operation not allowed.
> at com.sun.enterprise.distributedtx.UserTransactionImpl.checkUserTransactionMethodAccess(UserTransactionImpl.java:135)
> at com.sun.enterprise.distributedtx.UserTransactionImpl.getStatus(UserTransactionImpl.java:262)
> at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:237)
> at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:214)
> at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:444)
> at org.hibernate.impl.SessionImpl.get(SessionImpl.java:848)
> at org.hibernate.impl.SessionImpl.get(SessionImpl.java:836)
> at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
> at com.sun.enterprise.util.EntityManagerWrapper.find(EntityManagerWrapper.java:546)
> [Message sent by forum member 'milesy' (milesy)]
>
> http://forums.java.net/jive/thread.jspa?messageID=361381
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

_________________________________________________________________
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1