Hi again Tomasz Tomasz Wysocki wrote:
Hello,This is correct in the singlevm mode only. If you were running your app in c/s mode proxies would use the PersistenceBrokerClient to materialize references on demand!
I've been using OJB in a small web-application project, with a success.
It is performing nicely and a simple PB API is great ...
I'm considering, if OJB would be good for more complicated multi-tier application used in distributed environment.
Suppose we have some remote service returning results that contain persistent classes instances there is a problem if proxied references or collections are used.
PersistenceBroker field of CollectionProxy is transient, so instance will serialize correctly, and the same is true for IndirectionHandler.
But what if a service is truly remote, ie. there is no access to database on client side. There is no chance that PersistenceBroker brought up on a client side (by means of PBKey handle) could materialize proxied collections or references.
There even is no much sense in it, cause client can be many network hops away from server's database.IMO it makes sense if your app is running in c/s mode.
But I agree this solution might produce a lot of problems if used carelessly!
I think this problem could be resolved by providing a configuration option that would turn-on proxy materializing triggered by serialization of persistent classes. This would result in fully materialized model transfered to a client, and transparent proxy handling for serialization.Yes, this could be an elegant solution! AFAIK there are some callbacks in the serialization api that could help to implement this trick.
Only disatvantage I see: persistent classes must be derived from a base class implementing these callbacks?
Are you willing to work on this? I will review your stuff and integrate it into the codebase!What do you think?
I see!BTW. I don't want to use c/s mode.
We are currently discussing to drop the c/s mode altogether. The only *real* benefit the c/s mode had was the support for network-enabled proxies.
If we can replace this feature with your solution the last reason for c/s mode has gone and we could drop it without problems!
cheers,
Thomas
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]