Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Disconnected mode for Hibernate/teneo
Disconnected mode for Hibernate/teneo [message #108871] Tue, 29 January 2008 10:46 Go to next message
Eclipse UserFriend
Originally posted by: emilie.luno.eurogiciel.fr

Hi all,
I' not a specialist of Teneo, but to respond to my project needs
I have to propose a solution to work with Teneo :
- In a connected mode (to an Oracle DB)
- And in a disconnected mode (disconnected client, working in standalone
PC).

Is it possible to disconnect Hibernate from the DB, storing all the data
in local files for example?
Is it easy? How can we do that?

Thanks in advance
Emie
Re: Disconnected mode for Hibernate/teneo [message #108884 is a reply to message #108871] Tue, 29 January 2008 11:18 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Emie,
I never tried it, but you can try the following:
1- Open a hibernate resource and read the objects from the db
2- Locally store the objects by moving them to a xml/xmi (or other local) resource
3- Work with the local resource, changing and saving it
4- When it needs to be committed to the db: open a hibernate resource and move the objects back from
the xmi/xml resource to the hibernate resource and save the hibernate resource

In step 2 all lazy loaded collections should be initialized otherwise you will get incomplete
information in your local resource.

To let this work it is required that the objects have an explicit id and version annotated efeature
otherwise Hibernate will assume that the objects are new and create new records in the db. See here:
http://www.elver.org/hibernate/hibernate_details.html#Client -Server+scenario%3A+requires+explicitly+modelled+id+and+vers ion+properties

Let me know if the above works or does not work. It is an interesting scenario for which I am
interested to change Teneo to improve the fit.

gr. Martin

Euri wrote:
> Hi all,
> I' not a specialist of Teneo, but to respond to my project needs
> I have to propose a solution to work with Teneo :
> - In a connected mode (to an Oracle DB) - And in a disconnected mode
> (disconnected client, working in standalone PC).
>
> Is it possible to disconnect Hibernate from the DB, storing all the data
> in local files for example? Is it easy? How can we do that?
>
> Thanks in advance
> Emie
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Disconnected mode for Hibernate/teneo [message #108968 is a reply to message #108884] Tue, 29 January 2008 13:54 Go to previous message
Eclipse UserFriend
Originally posted by: emilie.luno.eurogiciel.fr

Thank you for your answer Martin.

I 'm not sure that we will follow your proposal, because the client wants
a simple implementation, an “industrial” application…
I was thinking that the Hibernate disconnect mode solution, for standalone
applications, was a solution used yet.

We can propose to the user a simple way to work in local: from our
application, we switch easily to a "local" HSQL DB, which can be used by
the disconnected client.

Regards,
Emie
Re: Disconnected mode for Hibernate/teneo [message #614132 is a reply to message #108871] Tue, 29 January 2008 11:18 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Emie,
I never tried it, but you can try the following:
1- Open a hibernate resource and read the objects from the db
2- Locally store the objects by moving them to a xml/xmi (or other local) resource
3- Work with the local resource, changing and saving it
4- When it needs to be committed to the db: open a hibernate resource and move the objects back from
the xmi/xml resource to the hibernate resource and save the hibernate resource

In step 2 all lazy loaded collections should be initialized otherwise you will get incomplete
information in your local resource.

To let this work it is required that the objects have an explicit id and version annotated efeature
otherwise Hibernate will assume that the objects are new and create new records in the db. See here:
http://www.elver.org/hibernate/hibernate_details.html#Client -Server+scenario%3A+requires+explicitly+modelled+id+and+vers ion+properties

Let me know if the above works or does not work. It is an interesting scenario for which I am
interested to change Teneo to improve the fit.

gr. Martin

Euri wrote:
> Hi all,
> I' not a specialist of Teneo, but to respond to my project needs
> I have to propose a solution to work with Teneo :
> - In a connected mode (to an Oracle DB) - And in a disconnected mode
> (disconnected client, working in standalone PC).
>
> Is it possible to disconnect Hibernate from the DB, storing all the data
> in local files for example? Is it easy? How can we do that?
>
> Thanks in advance
> Emie
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Disconnected mode for Hibernate/teneo [message #614139 is a reply to message #108884] Tue, 29 January 2008 13:54 Go to previous message
Eclipse UserFriend
Originally posted by: emilie.luno.eurogiciel.fr

Thank you for your answer Martin.

I 'm not sure that we will follow your proposal, because the client wants
a simple implementation, an “industrial” application…
I was thinking that the Hibernate disconnect mode solution, for standalone
applications, was a solution used yet.

We can propose to the user a simple way to work in local: from our
application, we switch easily to a "local" HSQL DB, which can be used by
the disconnected client.

Regards,
Emie
Previous Topic:[CDO] java.lang.NoClassDefFoundError: org/eclipse/emf/cdo/client/internal/ClientActivator
Next Topic:Re: Modeling tools
Goto Forum:
  


Current Time: Fri Apr 26 16:49:28 GMT 2024

Powered by FUDForum. Page generated in 0.03065 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top