[jboss-as7-dev] UserTransaction used by remote clients

Wolf-Dieter Fink wfink at redhat.com
Wed Mar 7 13:54:46 EST 2012


=====   Regarding node-name.   =====
In standalone I supposed it is the name of jboss-ejb-client.properties
     remote.connection.*default*.host=localhost
But I have to set it by -Djboss.node.name=<>.
???  it is not possible to add a system-property to the standalone.xml 
for that, or do I something wrong with the system-property element in 
configuration???
??? What is the name in domain mode? Is the <server name="" ...> 
attribute for each defined server used???
??? Is it possible to see the node name with the management console???

The section for remote invoking EJB's note that a node name must be set 
unique, but I did not see any problem if I start two instances (same 
machine) without jboss.node.name?
Is here a default created?


====  UserTransaction  =====
If I do this in my client:
{code}
1:       UserTransaction uTx = EJBClient.getUserTransaction("Wolf");
2:      LOG.debug("UserTransaction ="+uTx);
3:      uTx.begin();
4:      LOG.debug("Tx.begin() ok");
5:      bmtSession.checkTransaction(); // call a SLSB to use Tx
6:      uTx.commit();
         LOG.debug("Tx.commit() ok");
{code}

Line 1 and 3 works nevertheless whether there is a server (with or 
without a correct node.name) or not. The line 5: will fail 'No EJB 
receiver with 'node.name'
If I remove getUserTransaction I can execute the code nevertheless 
whether a node name is set or not.

???  So I suppose the getUTx will attach the next EJB call to that 
server ???

If a server is available the commit will fail (also the EJB 
checkTransaction show the TxState=6 (NO-Tx)
java.lang.IllegalStateException: BaseTransaction.commit - ARJUNA016074: 
no transaction!
     at 
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:113)
     at 
com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
     at 
org.jboss.as.ejb3.remote.protocol.versionone.UserTransactionCommitTask.manageTransaction(UserTransactionCommitTask.java:47)
     at 
org.jboss.as.ejb3.remote.protocol.versionone.UserTransactionManagementTask.run(UserTransactionManagementTask.java:64)
     at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
     at java.util.concurrent.FutureTask.run(FutureTask.java:166)
     at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
     at java.lang.Thread.run(Thread.java:679)
     at org.jboss.threads.JBossThread.run(JBossThread.java:122)


??? My question what is wrong with my assumption or code???


- Wolf


On 03/06/2012 06:28 PM, David M. Lloyd wrote:
> On 03/06/2012 11:17 AM, Wolf-Dieter Fink wrote:
>> Is it possible to lookup and use UserTransaction from a remote-client as
>> in AS5?
>> Or is it planned for further release?
> In AS 7, you can have a connection to more than one server at once.
> Thus you have to specify which server node you want to talk to.  The
> method you want is
> org.jboss.ejb.client.EJBClient#getUserTransaction(String), where the
> argument is the node name.  Note that your connection must already be
> established at this point.
>
> We do not presently have a way to pull a UserTransaction out of JNDI,
> though that could be considered for an enhancement.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20120307/57a6189b/attachment.html 


More information about the jboss-as7-dev mailing list