From: Marco T. <mt...@je...> - 2003-06-25 23:20:04
|
Could you please forward some example? Thanks, Marco ----- Original Message ----- From: "Marco Garbelini" <ma...@ga...> To: <jbo...@li...> Sent: Wednesday, June 25, 2003 11:57 PM Subject: Re: [JBoss-user] Question about CMP entity The concurrency issue is not that simple. I never understood how the EJB container deals with that completely. :-/ Anyway, I supose you are talking about PrimaryKey generation: I use the Sequence Blocks strategy from Floyd Marinescu´s book EJB Design Patterns. It consists of a CMP(in my case) entity bean used just to persist the last sequence used and a stateless session bean that caches blocks of sequences (due to performance issues). I think its´s pretty nice. Cheers, Marco ----- Original Message ----- From: "Marco Tedone" <mt...@je...> To: "JBoss-user-list" <jbo...@li...> Sent: Wednesday, June 25, 2003 7:06 PM Subject: [JBoss-user] Question about CMP entity > Sorry guru for the [silly] question: I am having a discussion with people in > my project regarding the container work with CMP entity beans. More > specifically, we want to implement a Numerator table to assign numbers to > several entities of our model. > > Suppose a client wants to assign a value to a peopleId field in a People > table, then it will in order: > > 1) Access the Numerator table (behind a CMP entity bean) > 2) Retrieve the value from the number field; > 3) Assign that value to peopleId > 4) Increment the value by 1 > > What I am saying to the guys in the project is that the container (Jboss in > our case) could ensure that, from the moment when the number is retrieved to > the moment when the number is incremented by 1 nobody else will be able to > alter the value of the number field in the Numerator table. Someone is > replying that we should implement a synchronized method. Is that really > necessary? I'm quite sure that there is a way to instruct the container to > 'lock' in a certain sense the value of the number field. One way could be a > transaction (shall we use synchronization in this case?); is there anything > simplier? > > Many thanks for your time, > > Marco > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > JBoss-user mailing list > JBo...@li... > https://lists.sourceforge.net/lists/listinfo/jboss-user > ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ JBoss-user mailing list JBo...@li... https://lists.sourceforge.net/lists/listinfo/jboss-user |