Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » hessian 3.1.16
hessian 3.1.16 [message #7640] Mon, 28 July 2008 05:30 Go to next message
david leloup is currently offline david leloup
Messages: 36
Registered: July 2009
Member
hi Christian,

i'd like to inform you that riena-m3 + hessian 3.1.13 + hibernate don't work
well together.
it was ok with m2

because hibernate transform list/sets and bags to a hibernate specific
collection class
and hessian 3.1.13 doesn't like it;

Ii've upgraded the jar in bundle to 3.1.16 and it works ok now.
hessian monitor error and continue to run
like this

ATTENTION: Hessian/Burlap: 'org.hibernate.collection.PersistentSet' is an
unknown class in
org.eclipse.core.runtime.internal.adaptor.ContextFinder@bd928a:
java.lang.ClassNotFoundException: org.hibernate.collection.PersistentSet
Re: hessian 3.1.16 [message #7660 is a reply to message #7640] Mon, 28 July 2008 08:48 Go to previous message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
Hi David,

I am aware that Hibernate Domain Objects always are a little tricky with Hessian. However we choose a different path
than you did and maybe you prefer that too.

Our approach is to leave hibernate solely on the server. The client talks to webservices but not to a database, so he
shouldnt have a hibernate jar in its classpath. However I know that when loading persistent objects from a database
using hibernate you get all these hibernate objects where they have collection type of objects.

I believe Hibernate does that to track changes for relations (not sure on this). But you can replace the PersitentSet
just with a regular Set. That does not corrupt your data model. What we did in the past and we havnt yet brought that
code into Riena is that we have a generic transformer for an object net, that converts all hibernate specific objects
into plain java objects. Once you have done that you can transport them without a problem with Hessian and you dont need
Hibernate on the client anymore. (which serves no purpose there anyway).

When you store objects you can then decide, whether you like to send the whole object net to the server (from the
client) and store that net with Hibernate or use Rienas Object Transactions to only send modified properties.

I admit that some of the work with Hibernate was done by a collegue and I havnt tried that myself, but I that is my
understanding what you should do.

Another solution that just come to my mind is that you could register the hibernate bundle as buddy of the hessian bundle.
Eclipse-RegisterBuddy: org.caucho.hessian
Since Hessian BuddyPolicy allowas registered buddies, that should allow Hessian to "see" the classes from
Hibernate....not my prefered solution but it should work.

I also assume that you did not mean hessian 3.1.13 and hessian 3.1.16 but instead hessian 3.1.3 and 3.1.6 ?

couldnt find release notes for 3.1.6.

but thanks for the information....

christian

david schrieb:
> hi Christian,
>
> i'd like to inform you that riena-m3 + hessian 3.1.13 + hibernate don't
> work well together.
> it was ok with m2
>
> because hibernate transform list/sets and bags to a hibernate specific
> collection class
> and hessian 3.1.13 doesn't like it;
>
> Ii've upgraded the jar in bundle to 3.1.16 and it works ok now.
> hessian monitor error and continue to run
> like this
>
> ATTENTION: Hessian/Burlap: 'org.hibernate.collection.PersistentSet' is
> an unknown class in
> org.eclipse.core.runtime.internal.adaptor.ContextFinder@bd928a:
> java.lang.ClassNotFoundException: org.hibernate.collection.PersistentSet
>
>
>
Re: hessian 3.1.16 [message #573161 is a reply to message #7640] Mon, 28 July 2008 08:48 Go to previous message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
Hi David,

I am aware that Hibernate Domain Objects always are a little tricky with Hessian. However we choose a different path
than you did and maybe you prefer that too.

Our approach is to leave hibernate solely on the server. The client talks to webservices but not to a database, so he
shouldnt have a hibernate jar in its classpath. However I know that when loading persistent objects from a database
using hibernate you get all these hibernate objects where they have collection type of objects.

I believe Hibernate does that to track changes for relations (not sure on this). But you can replace the PersitentSet
just with a regular Set. That does not corrupt your data model. What we did in the past and we havnt yet brought that
code into Riena is that we have a generic transformer for an object net, that converts all hibernate specific objects
into plain java objects. Once you have done that you can transport them without a problem with Hessian and you dont need
Hibernate on the client anymore. (which serves no purpose there anyway).

When you store objects you can then decide, whether you like to send the whole object net to the server (from the
client) and store that net with Hibernate or use Rienas Object Transactions to only send modified properties.

I admit that some of the work with Hibernate was done by a collegue and I havnt tried that myself, but I that is my
understanding what you should do.

Another solution that just come to my mind is that you could register the hibernate bundle as buddy of the hessian bundle.
Eclipse-RegisterBuddy: org.caucho.hessian
Since Hessian BuddyPolicy allowas registered buddies, that should allow Hessian to "see" the classes from
Hibernate....not my prefered solution but it should work.

I also assume that you did not mean hessian 3.1.13 and hessian 3.1.16 but instead hessian 3.1.3 and 3.1.6 ?

couldnt find release notes for 3.1.6.

but thanks for the information....

christian

david schrieb:
> hi Christian,
>
> i'd like to inform you that riena-m3 + hessian 3.1.13 + hibernate don't
> work well together.
> it was ok with m2
>
> because hibernate transform list/sets and bags to a hibernate specific
> collection class
> and hessian 3.1.13 doesn't like it;
>
> Ii've upgraded the jar in bundle to 3.1.16 and it works ok now.
> hessian monitor error and continue to run
> like this
>
> ATTENTION: Hessian/Burlap: 'org.hibernate.collection.PersistentSet' is
> an unknown class in
> org.eclipse.core.runtime.internal.adaptor.ContextFinder@bd928a:
> java.lang.ClassNotFoundException: org.hibernate.collection.PersistentSet
>
>
>
Previous Topic:hessian 3.1.16
Next Topic:Using Swing for ui interface
Goto Forum:
  


Current Time: Thu Jul 31 19:44:07 EDT 2014

Powered by FUDForum. Page generated in 0.02633 seconds