This content has been marked as final.
Show 2 replies
-
1. Re: Instance not automatically updated in 3.2.4RC2 ?
aloubyansky Mar 30, 2004 1:17 AM (in response to triathlon98)What is done in box.setSale( sale ); and piece2 = weightHome.create( piece2.getUOID() );?
-
2. Re: Instance not automatically updated in 3.2.4RC2 ?
triathlon98 Mar 30, 2004 2:54 AM (in response to triathlon98)Alex,
The create method looks liks thispublic void ejbCreate( UOID uoid ) throws CreateException { setUp( ); try { log.trace( "create Weight entity ejbCreate(" + uoid + ")" ); DMWeightEJBLocal entity = entityHome.findByPrimaryKey( uoid ); this.uoid = uoid; setMediator( entity ); } catch ( FinderException e ) { throw new CreateException( "Weight: UOID " + uoid.getId( ) + "not found" ); } }
It basically just makes sure the entity is available for the other methods. It then creates a mediator object to handle the getters and setters (this code is generated by Uni-d, an OSS project which (amongst other things) allows the creation of beans with inheritance). The mediator handles the inheritance dependencies.
The setSale is rather complex, but in short, it a certain condition is met, a finder on the entity beans is called and the state in these entity beans is modified. It is that change which is not visible.
I assume I could fix this by not caching the entity object, but by doing findByPrimaryKey each time I need it. However, this seems to be a very inefficient way to do things.
Joachim