Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » RCP client + Riena Equinox server + JPA/Hibernate
RCP client + Riena Equinox server + JPA/Hibernate [message #586755] Fri, 13 August 2010 09:17 Go to next message
Xino  is currently offline Xino
Messages: 18
Registered: July 2009
Junior Member
Hello,

My achitecture did change since my last thread :

I have :
1 plugin for the ui called ui plugin

1 plugin for the domain model with definitions of my data model with hibernate annotations.


1 for the services / dao.



To simplify :
A Pupil entity with a OneTOMany association with Subscritption entity.


1st scenario :
- Empty database
- Manually insert "Pupil"
- Update Pupil

--> everything works fine


2nd scenario :
- Stop the client
- relaunch the client
- Load the pupils
- update the pupils data
--> everything works fine


3rd scenario :
- Stop the server
- Relaunch the server
- relaunch the client
- Load the pupils
- update the pupils data
--> the famous LazyInitException : no session or session was closed with the subcription field


Of course, I made some google searches but did nt fout the solution.
they more often linked with JEE containers.

I supposed it's about session, persistence context but i am a newbie about hibernate.
I don't understand why it's ok in some cases but not in others.

My question : is there some basic code samples availables within this architecture : RCP - Riena/equinox server - JPA/hibernate
just show basics CRUD operation and others best practices about configuration and so on ?


A solution for my initial issue is also welcome.

Thanks in advance.
Re: RCP client + Riena Equinox server + JPA/Hibernate [message #586770 is a reply to message #586755] Mon, 16 August 2010 03:17 Go to previous message
Stephan Mann is currently offline Stephan Mann
Messages: 22
Registered: August 2010
Junior Member
On 13.08.2010 15:17, Xino wrote:
> [..]
> --> the famous LazyInitException : no session or session was closed with
> the subcription field
> [..]
> I don't understand why it's ok in some cases but not in others.

I'm guessing here but I would bet that you get this exception the moment
you have data in your OneToMany relation. As long as there is no data,
you'll get NULL or an empty set. But if there is data, you'll get an
Hibernate specific set implementation which fails to be deserialized on
the client.

You can verify this by setting a breakpoint in your service
implementation just after the data has been retrieved from the data base
and starting the client in debug mode.

> My question : is there some basic code samples availables within this
> architecture : RCP - Riena/equinox server - JPA/hibernate
> just show basics CRUD operation and others best practices about
> configuration and so on ?

AFAIK no, sorry.

> A solution for my initial issue is also welcome.

Please refer to my newsgroup post on 2010-08-09 and the follow-up post
[1]. It describes the solution to a very similar problem we had with
EclipseLink. I expect these solutions to be applicable to Hibernate.

hth, stephan

[1]
http://www.eclipse.org/forums/index.php?t=msg&th=173378& amp;start=0&S=7e36022d7bb4c80e99d26a086f4e776c
Previous Topic:Riena Talks
Next Topic:RCP client + Riena Equinox server + JPA/Hibernate
Goto Forum:
  


Current Time: Fri Apr 18 16:59:52 EDT 2014

Powered by FUDForum. Page generated in 0.01550 seconds