Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / August 2003

Tip: Looking for answers? Try searching our database.

Value Object and Entity Beans

Thread view: 
Tomer Ben-David - 11 Aug 2003 07:21 GMT
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
Øyvind Matheson Wergeland - 11 Aug 2003 08:24 GMT
> 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.

> however i want (ofcourse!) all of them to be synchronized
> with the same data!!
>
> Am I missing something about value objects?

Yes.

> 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.

Signature

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

Marek Lange - 11 Aug 2003 08:43 GMT
>> Now Im wondering its doing "new UserInfoEntityData()" that means that
>> if multiple clients connect to my server call this getValueObject then
[quoted text clipped - 8 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.