-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Remoting + Hibernate3 + Spring + .NET / Swing clients
PostPosted: Tue Mar 27, 2007 4:09 pm 
Newbie

Joined: Tue Mar 27, 2007 3:54 pm
Posts: 3
Dear Friends,

The problem is pertaining to the Lazy loading issues that we face when we use Remoting + Hibernate3 + Spring + .NET / Swing clients.

I have searched endless blogs / mailing lists and tried ALL possible options to make this combination work, before posting this email to you.

Problem:
-----------------------------------------------------------
Hibernate:
We have around 55 beans most of them related to each other via OneToMany and ManyToMany relationships, some being Lazy and some Eager. Collection types vary from ArrayList / HashMap and HashSet. This is a quite a complex maze of relationships that we have drawn. I have avoided getters / setters as advised by Java Beans and all our properties are public defined.

Remoting:
We have loaded the servlet using latest versions of Hessian / Burlap and HTTP Invoker. We would prefer to use Hessian because we are also connecting to our service via .NET clients. The servlet loads all 3 remoting methods and I try to connect via each of the transports individually from the client.

NOTE: I am using the latest version of Hibernate3 whose List / Map / Set definitions have changed since the earlier versions of Hibernate2. Most of the solutions provided pertained to Hibernate2 with simple class structures.

Solutions tried for the problem:
-----------------------------------------------------------
We have a maze of relationships and many such objects loading, I have tried the following options and NONE of them worked in any of the remoting methods:

1) I am trying various options to detach loaded Objects from Hibernate Cache, which I think would then make it easier to transmit data using any of the remoting methods.

* Do a Session.clear() so that all the loaded hibernate objects in the current session get detached!
* Recuersively traverse the Hibernate Tree and do a evict of all the objects, so that the objects get detached from the cache


2) Another option was to build a custom serializer for Hessian which will convert the Hibernate Collections to Java Collections.

* CustomSerializerFactory for Hessian that overrode ListSerializer / MapSerializer / SetSerializer for Hibernate3 (and not List / Map / Set interfaces of Hibernate2)


When using HTTPInvoker I get
Quote:
nested exception is java.io.StreamCorruptedException: invalid type code: AC
Caused by: java.io.StreamCorruptedException: invalid type code: AC
at java.io.ObjectInputStream.readObject0(Unknown Source)


When using Hessian / Burlap I get
Quote:
SEVERE: failed to lazily initialize a collection, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollect ion.throwLazyInitializationException(AbstractPersi stentCollection.java:358)


When using Hessian with Custom Serializer I get
Quote:
Caused by: com.caucho.hessian.io.HessianProtocolException: expected end of map ('z') at '?'
at com.caucho.hessian.io.HessianInput.error(HessianIn put.java:1647)
at com.caucho.hessian.io.HessianInput.readMapEnd(Hess ianInput.java:1225)


Can someone help / guide / advise me please.

Thanks in advance,
Rahul


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 3:45 am 
Newbie

Joined: Tue Mar 27, 2007 3:54 pm
Posts: 3
Can someone help me please with this problem?

I think the solution could be evicting ALL loaded objects from cache before the data is transmitted back to the remote client. Is my assumption right?

If you can advise us on a solution, preferably with a link to the supporting source code, that would be wonderful!!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 11:53 pm 
Newbie

Joined: Tue Mar 27, 2007 3:54 pm
Posts: 3
Can someone PLEASE help / guide me on how we could proceed?

Our customer is a leading banker here in India and their services are currently stuck until we manage to get a solution to this LazyLoading issue with Hibernate 3.

I have posted a similar message on Spring forum and sadly no response there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.