Is it possible to use a persistent class (i.e., a class derived from Entity) without a Session?

I have servers that retrieve objects from databases. The servers XML serialize these objects, then send them in messages to clients, which deserialize them. The clients have no direct access to the database. It appears that the clients need a Session to instantiate a persistent object, which in turn requires a Domain, which requires access to the database. How can I get around this problem?

asked Nov 12 '14 at 16:05

TimB's gravatar image

TimB
7558

Is it possible to have a Session that isn't bound to a database? Or maybe it's a Domain that isn't bound to a database? If I have to maintain parallel DTO classes just so I can serialize objects, that makes DO a much less attractive option.

(Nov 13 '14 at 11:30) TimB TimB's gravatar image

Sorry, but there is no way to create session or domain, which not bound to database.

(Nov 17 '14 at 04:22) Alexey Kulakov Alexey%20Kulakov's gravatar image

One Answer:

Hi TimB.

No, it's impossible. All Persistent objects are session bound object, including Entities. I thing you can convert DO entities to DTO objects and serialize these objects, and then deserialize them on client side.

answered Nov 12 '14 at 23:42

Alexey%20Kulakov's gravatar image

Alexey Kulakov
66215

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×14
×9

Asked: Nov 12 '14 at 16:05

Seen: 1,680 times

Last updated: Nov 17 '14 at 04:22

powered by OSQA