Thanks.

I got this sorted out. 

Here is my configuration:
OBJ.properties:
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl
useAutoCommit=0
ignoreAutoCommitExceptions=true
OJBTxManagerClass=org.apache.ojb.odmg.JTATxManager
JTATransactionManagerClass=org.apache.ojb.otm.transaction.factory.JBossTransactionManagerFactory

Here is my repository.xml:
   <jdbc-connection-descriptor
                jndi-datasource-name="java:/MySqlDS"
      platform="MySQL" 
      jdbc-level="2.0" 
                eager-release="true" 
    />

I have three methods in my SLSB. Two getters, one
update.

Two getters are works fine. The execution of update
(storeObject) works fine, however, the data didn't get
updated in the database.

In ejb-jar.xml:
     <transaction-type>Container</transaction-type>
  <trans-attribute>Required</trans-attribute>


Thanks for any tips.

Wei
======
This is my storeObject()
        public Object storeObject(Object object)
        {
                Log.info("Object: " + object);
                LaborLevelDef def = (LaborLevelDef)object;
                LaborLevelDef uDef = null;
                try
                {
                        Transaction tx = odmg.currentTransaction();
                        OQLQuery query = odmg.newOQLQuery();
                        query.create(
                                "select allObjects from "
                                        + LaborLevelDef.class.getName()
                                        + " where id="
                                        + def.getId());
                        Collection col = (Collection) query.execute();
                        Iterator it = col.iterator();
                        uDef = (LaborLevelDef)it.next();
                        tx.lock(uDef, Transaction.WRITE);
                        uDef.setFullName(def.getFullName());
                        uDef.setAbbreviation(def.getAbbreviation());
                        db.makePersistent(uDef);
                }
                catch (Exception e)
                {
                        Log.error("Failure while storing object " + object,
e);
                        //throw new OJBRuntimeException("Failure while
storing object", e);
                }
                return uDef;
        }

======
--- Michael Ansley <[EMAIL PROTECTED]>
wrote:
> The configuration that you are using
> (OJB.properties) is out of date.  You 
> probably have the wrong classes configured, and they
> changed between 0.9.7 
> and current.  Check the current values in the
> OJB.properties file, and adjust 
> as necessary.
> 
> Cheers...
> 
> 
> MikeA
> 
> 
> On Sunday 05 January 2003 16:29, Wei Guan wrote:
> > I configured OJB with JBoss, got this error:
> >
> > [05 Jan 2003 10:22:11  INFO]
> [HttpProcessor[8080][2]]
> > - Value
> >
>
"org.apache.ojb.broker.accesslayer.ConnectionFactoryPassThroughImpl"
> > is illegal for key "ConnectionFactoryClass"
> (should be
> > a class, using default value
> >
>
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl)
> >
> > In my stateless session bean, I have a getter:
> >     public Collection getLaborLevel()
> >     {
> >             Log.info("getLaborLevel was called");
> >             try
> >             {
> >                     OQLQuery query = odmg.newOQLQuery();
> >                     query.create(
> >                             "select allObjects from " +
> > LaborLevelDef.class.getName());
> >                     return (Collection) query.execute();
> >             }
> >             catch (QueryException e)
> >             {
> >                     System.out.println("in LaborLevelSessionbean: "
> +
> > e);
> >                     throw new EJBException("Query objects failed",
> e);
> >             }
> >     }
> >
> > The transaction type for the EJB is "Container"
> and
> > the transaction-attribute for this method is
> > "Required" (I tried "NotSupported" also). I got
> this
> > error:
> >
> > [05 Jan 2003 10:22:13  INFO]
> [HttpProcessor[8080][2]]
> > - [org.apache.ojb.broker.a
> > ccesslayer.ConnectionManager] ERROR: ^M
> > [05 Jan 2003 10:22:13  INFO]
> [HttpProcessor[8080][2]]
> > - Commit on underlying con
> > nection failed, try to rollback^M
> > [05 Jan 2003 10:22:13  INFO]
> [HttpProcessor[8080][2]]
> > - You cannot commit during
> >  a managed transaction!^M
> > [05 Jan 2003 10:22:13 ERROR]
> [HttpProcessor[8080][2]]
> > - java.sql.SQLException: Y
> > ou cannot commit during a managed transaction!^M
> > [05 Jan 2003 10:22:13 ERROR]
> [HttpProcessor[8080][2]]
> > -         at org.jboss.res
> >
>
ource.adapter.jdbc.local.LocalManagedConnection.jdbcCommit(LocalManagedConn
> >ectio n.java:456)^M
> > [05 Jan 2003 10:22:13 ERROR]
> [HttpProcessor[8080][2]]
> > -         at org.jboss.res
> >
>
ource.adapter.jdbc.local.LocalConnection.commit(LocalConnection.java:447)^M
> > [05 Jan 2003 10:22:13 ERROR]
> [HttpProcessor[8080][2]]
> > -         at org.apache.oj
> >
>
b.broker.accesslayer.ConnectionManager.localCommit(Unknown
> > Source)^M
> > [05 Jan 2003 10:22:13 ERROR]
> [HttpProcessor[8080][2]]
> > -         at org.apache.oj
> >
>
b.broker.singlevm.PersistenceBrokerImpl.commitTransaction(Unknown
> > Source)^M
> > [05 Jan 2003 10:22:13 ERROR]
> [HttpProcessor[8080][2]]
> > -         at org.apache.oj
> >
>
b.broker.singlevm.DelegatingPersistenceBroker.commitTransaction(Unknown
> > Source)^
> >
> > Any insight is highly-appreciated
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > http://mailplus.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to