this is my stack trace

[DEBUG]- timestamp : 1011863524612              this the timestamp of the object i 
pass 
through the session
[DEBUG]- timestamp : 1011863524612              this the timestamp of the current
object i want to update (so i' am sure it bthe same object and i wasn't
modifed)
[DEBUG]- ##49##                         --
[DEBUG]- ##titi##                                 |
[DEBUG]- ##titi##                                 |
[DEBUG]- ##code060##                              |
[DEBUG]- ##2##                            |
[DEBUG]- ##secret##                               |
[DEBUG]- ##null##                                 |  the ##data## i want to store 
(theres no ""
values)
[DEBUG]- ##null##                                 |
[DEBUG]- ##null##                                 |
[DEBUG]- ##2002-04-23##                   |
[DEBUG]- ##2002-01-23##                   |
[DEBUG]- ##N##                          --
[pilote] Castor: Storing cg95.pilote.metier.HabilitationMetier (49)
org.exolab.castor.jdo.ObjectModifiedException: Transaction aborted: Object 
of type cg95.pilote.metier.HabilitationMetier with identity 49 has been 
modified by a concurrent transaction
        at org.exolab.castor.jdo.engine.SQLEngine.store(SQLEngine.java:867)
        at org.exolab.castor.persist.ClassMolder.store(ClassMolder.java:  
1584)
        at org.exolab.castor.persist.LockEngine.store(LockEngine.java:758)
        at 
org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.  
java:1457)
        at 
org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:499)
        at 
cg95.pilote.metier.HabilitationMetier.setHabilitation(HabilitationMetier  
.java:321)
        at 
cg95.pilote.action.EditHabilitationAction.perform(EditHabilitationAction  
.java:169)
        at 
org.apache.struts.action.ActionServlet.processActionPerform(ActionServle  
t.java:1786)
        at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
        at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) 
       at javax.servlet.http.HttpServlet.service(HttpServlet.java)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java)
        at org.apache.tomcat.facade.ServletHandler.doService(Unknown Sou  
rce)
        at org.apache.tomcat.core.Handler.invoke(Unknown Source)
        at org.apache.tomcat.core.Handler.service(Unknown Source)
        at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
        at org.apache.tomcat.core.ContextManager.internalService(Unknown 
Source)        at org.apache.tomcat.core.ContextManager.service(Unknown 
Source)
        at 
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unk  
nown Source)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown 
Source)
        at java.lang.Thread.run(Thread.java:484)

##############################################
this is my mapping
        <mapping>
        <!--  Mapping for Utilisateur  -->
        <class name="cg95.pilote.metier.HabilitationMetier"
                identity="oid" key-generator="IDENTITY">
                <description>Utilisateur</description>
                <cache-type type="unlimited"/>
                <map-to table="utilisateur" xml="utilisateur" />
                <field name="oid" type="long" >
                        <sql name="uti_oid" type="integer"/>
                </field>
                <field name="code_fonction" type="long" >
                        <sql name="uti_fon_n_code" type="integer"/>
                </field>
        </class>
        </mapping>
#########################################
this my class which load my persistent object
        public static ObjectPersistent FindByPrimaryKey(Long _oid)
        throws ObjectNotFoundException, PersistenceException
        {
                Database db = InitPiloteApplication._db;
                try
                {
                        db.begin();
                        HabilitationMetier habilitationMetier = (HabilitationMetier) 
db.load(HabilitationMetier.class, _oid);
                        cat.debug("timestamp : " + 
habilitationMetier.jdoGetTimeStamp());
                        db.commit();
                        return(habilitationMetier);
                }
                catch(ObjectNotFoundException onfe)
                {
                        db.rollback();
                        onfe.printStackTrace();
                        cat.error("erreur : " + onfe);
                        throw new ObjectNotFoundException(onfe.toString());
                }
                catch(PersistenceException pe)
                {
                        db.rollback();
                        pe.printStackTrace();
                        cat.error("erreur : " + pe);
                        throw new PersistenceException(pe.toString());
                }
        }

######################################
this is my class which store my persistent object
        public void set(BeanMetier _bean)
        throws PersistenceException
        {
                Database db = InitPiloteApplication._db;
                cat.debug("timestamp : " + this.jdoGetTimeStamp());
                try
                {
                        //db.setAutoStore(true);
                        cat.debug("timestamp : " + this.jdoGetTimeStamp());
                        db.begin();
                        this.beanMetierToObjectPersistent((HabilitationBean) _bean);
                        cat.debug("##" + this.getOid() + "##");
                        cat.debug("##" + this.getNom() + "##");
                        cat.debug("##" + this.getPrenom() + "##");
                        cat.debug("##" + this.getCodac() + "##");
                        cat.debug("##" + this.getCode_fonction() + "##");
                        cat.debug("##" + this.getPassword() + "##");
                        cat.debug("##" + this.getPassword1() + "##");
                        cat.debug("##" + this.getPassword2() + "##");
                        cat.debug("##" + this.getPassword3() + "##");
                        cat.debug("##" + this.getFin_password() + "##");
                        cat.debug("##" + this.getDerniere_connexion() + "##");
                        cat.debug("##" + this.getIndicateur() + "##");
                        db.update(this);
                        db.commit();
                }
                catch(PersistenceException pe)
                {
                        //db.rollback();
                        pe.printStackTrace();
                        cat.error("erreur : " + pe);
                        throw new PersistenceException(pe.toString());
                }
        }

thanks for answers

Ben
-----Message d'origine-----
De:     Oleg Nitz [SMTP:[EMAIL PROTECTED]]
Date:   jeudi 24 janvier 2002 10:08
A:      [EMAIL PROTECTED]
Objet:  Re: [castor-dev] Long Transaction Problem !!! HELP

Tancerel wrote:
> and i also try with <cache-type type="none"/>
> and it doesn't execute my db.update
:)))
Sorry Ben for my bad wording, I know that this won't worked,
I thougth that your ObjectModifiedException might be caused by such
setting.
But if you tried <cache-type type="unlimited"/> and still got the
ObjectModifiedException than the problem doesn't relate to the cache.
Please send the stack trace of the exception and a part of mapping.xml
that relates to the class we speak about.

Oleg

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to