AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Value Object and Entity Beans

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JavaBeans
View previous topic :: View next topic  
Author Message
Tomer Ben-David
Guest





PostPosted: Mon Aug 11, 2003 6:21 am    Post subject: Value Object and Entity Beans Reply with quote



Hi

Im a newbie :)

Here is an implementation that one EJB engine has generated (I
manipulated abit added one property but generaly it was generated by
it...) :

* @ejb.interface-method view-type="local"
* @--ejb.transaction type="Required"
* @ejb.permission unchecked="true"
**/
public UserInfoEntityData getValueObject()
{
UserInfoEntityData valueObj = new UserInfoEntityData();

valueObj.setUsername(getUsername());
valueObj.setSex(getSex());
return valueObj;
}


Now Im wondering its doing "new UserInfoEntityData()" that means that
if multiple clients connect to my server call this getValueObject then
every one of those clients will get a different reference to a
different value object.

So different clients can update different details on different value
objects! however i want (ofcourse!) all of them to be synchronized
with the same data!!

Am I missing something about value objects? aren't they synchronized
around clients?

Thanks in advance,

Tomer
Back to top
Øyvind Matheson Wergeland
Guest





PostPosted: Mon Aug 11, 2003 7:24 am    Post subject: Re: Value Object and Entity Beans Reply with quote



Tomer Ben-David wrote:
Quote:
Now Im wondering its doing "new UserInfoEntityData()" that means that
if multiple clients connect to my server call this getValueObject then
every one of those clients will get a different reference to a
different value object.

Yes.

Quote:
So different clients can update different details on different value
objects!

Yes. Also note that a client merely updating a value object changes
nothing on the server side or in the database.

Quote:
however i want (ofcourse!) all of them to be synchronized
with the same data!!

Am I missing something about value objects?

Yes.

Quote:
aren't they synchronized around clients?

No.

Either, don't use value objects if it is not necessary for performance,
or use user transactions in the clients where updating value objects.

--
Øyvind Matheson Wergeland Just Another Virtual Application
Senior System Developer
Manamind AS Creating the Corporate Information Feed [tm]


Back to top
Marek Lange
Guest





PostPosted: Mon Aug 11, 2003 7:43 am    Post subject: Re: Value Object and Entity Beans Reply with quote



Øyvind Matheson Wergeland wrote:

Quote:
Tomer Ben-David wrote:

Now Im wondering its doing "new UserInfoEntityData()" that means that
if multiple clients connect to my server call this getValueObject then
every one of those clients will get a different reference to a
different value object.


Yes.

So different clients can update different details on different value
objects!


Yes. Also note that a client merely updating a value object changes
nothing on the server side or in the database.

That's the point. Value objects are used to pass data from server to
client and vice versa. Changing a value object does not mean to change
the database data.

-marek


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JavaBeans All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.