Hi Stephen,

----- Original Message -----
From: "Stephen Ting" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Wednesday, July 16, 2003 12:36 PM
Subject: RE: Transaction in PB api


> Hi Armin,
>
> In addition to this, (Base on the testing in attach) if in 2 tiers
> testing for PB api, if the transaction is rollback because of error in
> LogPondBlock object, the LogPond object will not be persist but in 3
> tiers(Jboss) it will. Is there any particular setting in should take
> care of in 3 tiers?
>
maybe it's a side-effect of eager-release 'true' setting in jboss.
Try to repeat the test with eager-release 'false'.
What's now the result?

Hope to find a fix for the 'eager-release' problem in jboss
in near future.

regards,
Armin

>
> >-----Original Message-----
> >From: Stephen Ting [mailto:[EMAIL PROTECTED]
> >Sent: 16 July 2003 18:28
> >To: 'OJB Users List'; 'Armin Waibel'
> >Subject: RE: Transaction in PB api
> >
> >
> >Hi Armin,
> >
> >Thanks for replying.
> >
> >I am using container-managed transaction in the session bean.
> >I didn't used OJB sequence manager to generate the sequence
> >number, I manually set the sequence number. So, I think
> >shouldn't be the problems of sequence manager.
> >
> >I have same SQL exception in 2-tiers..if using ODMG api. If
> >using PB api, I have no problems.
> >
> >My test code for 2 tiers usage.
> >
> > public void testODMG() throws Exception{
> > Implementation odmg = OJB.getInstance();
> > Database db = odmg.newDatabase();
> >
{ 
> > 
> >db.open(TestHelper.createSite().getDbConnectionAlias(), 
> > Database.OPEN_READ_WRITE);
> > Transaction tx = odmg.newTransaction();
> > tx.begin();
> > LogPond lp = createLogPond();
> > file://tx.lock(document, Database.OPEN_READ_WRITE);
> > db.makePersistent(lp);
> > tx.commit();
> > 
> > System.out.println(lp.toString());
> > 
> > }catch(ODMGException e){
> > throw new BDException(e.getMessage());
> >
> > }
> > 

> >
> >
> > }
> > public void testPB() throws Exception{
> > PersistenceBroker broker = null;
> >
> >
{ 
> > broker =
> >PersistenceBrokerFactory.createPersistenceBroker(
> > new
> >PBKey(TestHelper.createSite().getDbConnectionAlias()));
> > broker.beginTransaction();
> > LogPond lp = createLogPond();
> > broker.store(lp);
> > broker.commitTransaction();
> > }catch(Exception e){
> > broker.abortTransaction();
> > e.printStackTrace();
> >
> > }
> >
> >
> > public LogPond createLogPond(){
> > 
> > LogPond doc = new LogPond();
> > doc.setId("logPond1");
> > doc.setName("sypmyylogpond");
> > doc.setRemark("anythign here");
> > 
> > for(int i=1; i<=1; i++){
> > LogPondBlock item = new LogPondBlock();
> > item.setId(Integer.toString(i));
> >
> > item.setName("zedteeblock1");
> > item.setRemark("anything here");
> > item.setLogPond(doc);
> > doc.addLogPondBlock(item);
> > }
> > return doc; 
> > } 
> >   <class-descriptor
> >     class="my.com.shinyang.eply.model.LogPondBlock"
> >     table="LOG_POND_BLOCK">
> >
> > <field-descriptor 
> >         name="id"
> >         column="ID"
> >         jdbc-type="VARCHAR"
> >         primarykey="true"         
> >      />
> > <field-descriptor 
> >         name="logPondId"
> >         column="LOG_POND_ID"
> >         jdbc-type="VARCHAR"      
> >      />
> > <field-descriptor 
> >         name="name"
> >         column="NAME"
> >         jdbc-type="VARCHAR"      
> >      />
> > <field-descriptor 
> >         name="volume"
> >         column="VOLUME"
> >         jdbc-type="DECIMAL"      
> >      />
> > <field-descriptor 
> >         name="pieces"
> >         column="PIECES"
> >         jdbc-type="INTEGER"      
> >      />
> > <field-descriptor 
> >         name="remark"
> >         column="REMARK"
> >         jdbc-type="VARCHAR"      
> >      />
> >      <collection-descriptor
> >         name="logList"
> >         element-class-ref="my.com.shinyang.eply.model.Log"
> >         auto-retrieve="fal
se"
> >         auto-update="false"
> >         auto-delete="false">
> >         <inverse-foreignkey field-ref="id"/>
> >      </collection-descriptor>
> >   </class-descriptor>
> >
> >   <class-descriptor
> >     class="my.com.shinyang.eply.model.LogPond"
> >     table="LOG_POND">
> >
> > <field-descriptor
> >         name="id"
> >         column="ID"
> >         jdbc-type="VARCHAR"
> >         primarykey="true"
> >      />
> > <field-descriptor
> >         name="name"
> >         column="NAME"
> >         jdbc-type="VARCHAR"
> >      />
> > <field-descriptor
> >         name="volume"
> >         column="VOLUME"
> >         jdbc-type="DECIMAL"
> >      />
> > <field-descriptor
> >         name="pieces"
> >         column="PIECES"
> >         jdbc-type="INTEGER"
> >      />
> > <field-descriptor
> >         name="remark"
> >         column="REMARK"
> >         jdbc-type="VARCHAR"
> >      />
> >      <collection-descriptor
> >         name="logPondBlockList"
> >
> >element-class-ref="my.com.shinyang.eply.model.LogPondBlock"
> >         auto-retrieve="true"
> >         auto-update="true"
> >         auto-delete="true">
> >         <inverse-foreignkey field-ref="logPondId"/>
> >      </collection-descriptor>
> > </class-descriptor>
> >
> >Thanks
> >
> >Regards,
> >Stephen
> >




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

Reply via email to