I've been working for a couple of days on this problem -- my entity beans don't seem to be passivating (in other words, never comitting to the database unless I use JonasAdmin).
 
I am using client transactions, with code like this (in my client):
 
UserTransaction utx = (UserTransaction)PortableRemoteObject.narrow(new InitialContext().lookup("javax.transaction.UserTransaction"),UserTransaction.class);
utx.begin();
CustomerHome home = (CustomerHome)getHome("CustomerHome");
Customer c = home.create(id);
c.setEmail(email);
c.setUsername(username);
utx.commit();
My jonas-ejb-jar.xml file contains descriptors like this:
 
    <jonas-entity>
        <ejb-name>Customer</ejb-name>
        <passivation-timeout>5</passivation-timeout>
        <is-modified-method-name>isModified</is-modified-method-name>
        <jndi-name>CustomerHome</jndi-name>
My ejb-jar.xml file contains transaction descriptors like this:
 
    <container-transaction>
        <method>
            <ejb-name>Customer</ejb-name>
            <method-name>*</method-name>
        </method>
        <trans-attribute>Supports</trans-attribute>
    </container-transaction>
I am using RedHat linux 7.0, Sun JDK 1.3, and JOnAS 2.2.4 (but with GenIC 2.2.5).
 
This is an important problem to solve for me, because I have an external process which runs every so often, which accesses the database directly (and needs correct data). However, I have a reasonable workaround in place until I solve this problem, and that is, I am using crontab to execute "JonasAdmin -sync" every 60 seconds.
 
Thanks,
 
Bryan
 

Reply via email to