db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: JDO with CMT.
Date Fri, 04 Feb 2005 22:20:59 GMT
You cannot simply call makePersistent, you have to start a transaction
first (this is unrelated to whether you're using it with EJB or not):

Transaction tx = null;

try
{
    tx = manager.currentTransaction();
    tx.begin();
    manager.makePersistent(user);
    tx.commit();
}
catch (Exception e)
{
    if (tx.isActive())
    {
        tx.rollback();
    }
}

Have a look here for an example of using JDO:

http://www.onjava.com/pub/a/onjava/excerpt/chap_07/index2.html

Btw, please post questions like these to the user list, not the dev
list, so that other users can help you or learn something from it.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message