Hello,

I'm trying to use OJB/JDO 0.98. I am using Netbeans followed instructions for 
deployment. I want to store object Test from package abo (that's mine package and 
object), and when I call "manager.makePersistent(test)" teher is a Exception:

javax.jdo.JDOUserException: Object not PersistenceCapable. FailedObject:abo.Test@766a24

at com.sun.jdori.common.PersistenceManagerImpl.assertPersistenceCapable(Unknown Source)

at com.sun.jdori.common.PersistenceManagerImpl.makePersistentInternal(Unknown Source)

at com.sun.jdori.common.PersistenceManagerImpl.makePersistent(Unknown Source)

at com.sun.jdori.common.PersistenceManagerWrapper.makePersistent(Unknown Source)



Code looks like this:
*************************
Test test =3D new Test();
manager =3D factory.getPersistenceManager();
Transaction tx =3D null;
tx =3D manager.currentTransaction();
tx.begin();
manager.makePersistent(test);
tx.commit();
manager.close();
************************
and object test like this (is it neccessary to implement Serializable?):

***************************
public class Test implements Serializable {

    protected int oid;

    protected int cislo = 5;

    protected String nazev = "Pokus";

    /** Creates a new instance of Test */
    public Test() {
    }

    public Test(int aCislo, String aNazev) {
        this.cislo = aCislo;
        this.nazev = aNazev;
    }

    public void setCislo(int aCislo) {
        this.cislo = aCislo;
   }

    public void setNazev(String aNazev) {
        this.nazev = aNazev;
   }

    public int getCislo() {
        return this.cislo;
   }

    public String getNazev() {
        return this.nazev;
   }

}

***********************

Dont you know where is the problem?

Thanks

Tomas Klubal :-)

E-mail: [EMAIL PROTECTED]

Tomas Klubal :-)
E-mail: [EMAIL PROTECTED]


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

Reply via email to