I have the following piece of code in my test suite :

  |     public void testBoxSale()
  |         throws Exception
  |     {
  |         // create the necessaty stuff
  |         BatchSelectorEJB batchSelector = batchSelectorHome.create();
  |         WeightEJB box = weightHome.create( WeightConstants.TYPE_ArticleWeight, 
"01" );
  |         box.setPackagingType( WeightConstants.PACKAGING_TYPE_BOX );
  |         WeightEJB piece1 = weightHome.create( WeightConstants.TYPE_ArticleWeight, 
"01" );
  |         piece1.setPackagingGroup( box );
  |         WeightEJB piece2 = weightHome.create( WeightConstants.TYPE_ArticleWeight, 
"01" );
  |         piece2.setPackagingGroup( box );
  |         WeightGroupEJB sale = weightGroupHome.create( "R" + 
System.currentTimeMillis() );
  | 
  |         // sell piece1 and check that the piece is no longer part of the box
  |         assertNotNull( piece1.getPackagingGroup() );
  |         piece1.setSale( sale );
  |         assertNull( piece1.getPackagingGroup() );
  |         // the other piece and the box are not yet sold
  |         assertNull( box.getSale() );
  |         assertNull( piece2.getSale() );
  |         assertEquals( box.getUOID(), piece2.getPackagingGroup().getUOID() );
  | 
  |         // sell the box and check that piece2 is also sold
  |         box.setSale( sale );
  |         assertEquals( sale.getUOID(), box.getSale().getUOID() );
  |         // @todo following line was not necessary before, but it is in JBoss 
3.2.4RC2 
  |         piece2 = weightHome.create( piece2.getUOID() );
  |         assertNotNull( piece2.getSale() );
  |         assertEquals( sale.getUOID(), piece2.getSale().getUOID() );
  | 
  |         // cleanup
  |         piece1.remove();
  |         piece2.remove();
  |         box.remove();
  |         sale.remove();
  |         batchSelector.remove();
  |     }
  | 


The important piece is in bold.
the sale, piece1 and piece2 objects are session facades for entity beans. Before, 
calling box.setSale has its sideeffects immediately visible in the piece2 SFSB, but 
this is no longer true, I now have to recreate the session facade for the changes to 
be visible.

What could be causing this or how can I fix it?

Joachim

W

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3827988#3827988

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3827988


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to