Hi,

I want to use Client-controlled transactions by using UserTransaction. When
testing it, some problems occured. See this code:

         UserTransaction ta = null;
         try {
            String key = null;
            MyBean b = null;
            ta = EJBUtil.getTransaction ();
            ta.setTransactionTimeout(5) ;
            ta.begin ();
            MyBeanHome home = (MyBeanHome)EJBUtil.findHome ("MyBean");
            boolean doRollback = args[0].equals("x");
            for (int i = 1; i<args.length; i++) {
               key = args[i];
               b = loadOrCreateMyBean (home, key);
               b.setValue ("Some vaule..."+key);
               log.info ("Value is: "+b.getValue());
            }
            if (doRollback) {
               ta.rollback();
            }
            else {
               ta.commit ();
            }
         }
         catch (Exception ex) {
            log.error ("...Ooops", ex);
            try {
               ta.rollback();
            }
            catch (Exception rex) {
               log.error ("ROLLBACK failed!", rex);
            }
         }

Now, when calling the code the first time, the objects are created, at least
they are complete in JBoss memory cache, BUT the value of the last created
bean is not present in the database! 
The second call to this code, using the same keys updating the beans, hangs
in the commit() call and does not return, allthough the timeout is set to 5
secs (I got a trace message on the server console, but the client keeps
hanging).

What's wrong?

I'm using JBoss 2.4.0, CMP for the beans, no specific Transaction-attribute
(so all are Required) and Oracle.

So, please help, we need this feature urgently....

Thanks, Lutz.

Lutz Hilken 
IT-Consult 
IVU Traffic Technologies AG 
Bundesallee 88, D-12161 Berlin 
Telefon: +49.30.85 906-450, Telefax: +49.30.85 906-499 
[EMAIL PROTECTED], www.ivu.de

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to