Hello,
I have some problems when trying to run the ClientOp example in JOnAS 2.2.2
. I've tried running it with JOnAS 2.1.1 and it ran successfully.
I have configured JOnAS with the following settings:
<ejb-jar>
<description>Deployment descriptor for the sb JOnAS example</description>
<enterprise-beans>
...
<transaction-type>Container</transaction-type>
</enterprise-beans>
<assembly-descriptor>
...
<container-transaction>
<method>
<ejb-name>Op</ejb-name>
<method-name>buy</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
As far as I understand, this means that when I use my ClientOp, then the
Container should create a UserTransaction object. However, this doesn't
happen. The following code describes what I'm trying to do:
UserTransaction utx = null;
try {
utx = (UserTransaction)
PortableRemoteObject.narrow(initialContext.lookup("javax.transaction.UserTra
nsaction"),
UserTransaction.class);
} catch (Exception e) {
System.err.println("Cannot lookup UserTransaction: "+e);
System.exit(2);
}
// OpBean creation
Op t1 = null;
try {
System.out.println("Create a bean");
t1 = home.create("User1");
} catch (Exception e) {
System.err.println("Cannot create OpBean: " + e);
System.exit(2);
}
// Start another transaction (rolled back)
try {
System.out.println("Start a second transaction");
utx.begin();
t1.buy(50);
System.out.println("Rollback the transaction");
utx.rollback();
} catch (Exception e) {
System.err.println("exception during 2nd Tx: " + e);
System.exit(2);
}
When the t1.buy() method is called, a new UserTransaction object is created
instead of using the already existing transaction. Then, when I try to
invoke rollback(), it doesn't work.
The only output I got is: "Bad value read: 80"
Am I doing something wrong? Or is it a 2.2.2 problem?
Thanks in advance,
...fernando
---
Fernando Koch <[EMAIL PROTECTED]>
Teradev SRL: www.teradev.com.ar
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".