Hi!

Sebastien Alborini wrote:
> > 2) rely on the format of the handle not to change? (i.e. if we change
> > the way handles are serialized it will break)
> 
> Yes it will.  Why would we do that?

Wrong question. Do not ever anticipate "no change". Bad bad bad. For
example, what if we decide to include the name of the server from which
we load the bean (to support multi-server setup)? Then the format
changes. Or if the distribution plugin is changed to use some other type
of reference info.

I'm telling you, using handles as a way to solve references is very
weak. They were not intended for this purpose. The original intent,
AFAICT, was to allow serialization of stateful session beans that
references other beans. Since SFulSB's are relatively short-lived and
there are no guarantees that the server will keep them alive, using
handles for references is just fine. Format of handles changes? Fine,
just kill the existing beans, since the app. must be able to deal with
this anyway.

With EntityBeans it's a whole other story, since they are A LOT more
long-lived. The only way to properly store EntityBean references in a
long-term fashion (be it single-reference or collection-reference) is to
use its primary key (the key word being "properly"). That way we can
change pretty much everything else, heck the user can even change to
another server, without breaking the data it has. 

This also makes it MUCH easier to use a legacy database, since the
references will have been done as foreign key relations, not as jBoss
handles.

Do you see my points? Do you find them strange/weak/wrong?

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to