Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO Teneo] Hibernate Store standalone server example?
[CDO Teneo] Hibernate Store standalone server example? [message #509691] Sun, 24 January 2010 16:04 Go to next message
Eclipse UserFriend
Originally posted by: austin.teng.siemens.com

Although the new documentation (1) offers a good example of a CDO
Hibernate Store running within Eclipse, I can't seem to find one for a
standalone server (non-OSGi). I've read that this is supported (2).
Has anyone gotten this working that can provide some insight?

Or barring that, is there an easy way to deploy an OSGi-based
application in a server environment? I suppose it would be similar to
an RCP app, but headless.

Thanks in advance,
Austin

(1) http://wiki.eclipse.org/CDO_Hibernate_Store
(2) Server Side Features: http://wiki.eclipse.org/CDO
Re: [CDO Teneo] Hibernate Store standalone server example? [message #509692 is a reply to message #509691] Sun, 24 January 2010 21:31 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Austin,
I am not sure if this answers your question but have you checked out this part of the documentation:
http://wiki.eclipse.org/User_Contributed_CDO_Documentation#S nippets
and then specifically the spring-wired docs.

Maybe Eike or others can add more pointers.

gr. Martin

Austin Teng wrote:
> Although the new documentation (1) offers a good example of a CDO
> Hibernate Store running within Eclipse, I can't seem to find one for a
> standalone server (non-OSGi). I've read that this is supported (2). Has
> anyone gotten this working that can provide some insight?
>
> Or barring that, is there an easy way to deploy an OSGi-based
> application in a server environment? I suppose it would be similar to
> an RCP app, but headless.
>
> Thanks in advance,
> Austin
>
> (1) http://wiki.eclipse.org/CDO_Hibernate_Store
> (2) Server Side Features: http://wiki.eclipse.org/CDO


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [CDO Teneo] Hibernate Store standalone server example? [message #509702 is a reply to message #509692] Mon, 25 January 2010 00:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: austin.teng.siemens.com

I'm not using Spring, but I'll see what I can take from it. Thanks.

I've run into something else that has me stumped. I'm trying to correct
the following error I get when attempting to save my model:

[ERROR] Row was updated or deleted by another transaction (or
unsaved-value mapping was incorrect)

Hibernate is trying to update a table when it should be doing an insert
(the object hasn't been persisted yet).

I've assigning a pre-generated ID to the object being saved (whose ID is
mapped to the primary key) before being saved, which is causing
Hibernate to treat the object as if it already exists in the database
(thus update instead of insert).

The dynamically generated hibernate-mapping contains the following:

<id name="id" type="java.lang.String" unsaved-value="">
<column not-null="true" unique="false" name="`id`"/>
</id>

But, I believe it should be something more like this:

<id name="id" type="java.lang.String">
<column not-null="true" unique="false" name="`id`"/>
<generator class="assigned"/>
</id>

Is it still possible to force Teneo to use the Hibernate mapping file
with CDO? I've tried setting the following property in the
cdo-server.xml config file...

<property name="teneo.mapping.use_mapping_file" value="true"/>

....but it doesn't seem to actually honor the entry. There is some
documentation on it on elver.org, but I assume it's out of date compared
to the new documentation.

Can you point me in the right direction?

Thanks again,
Austin


On 1/24/10 3:31 PM, Martin Taal wrote:
> Hi Austin,
> I am not sure if this answers your question but have you checked out
> this part of the documentation:
> http://wiki.eclipse.org/User_Contributed_CDO_Documentation#S nippets
> and then specifically the spring-wired docs.
>
> Maybe Eike or others can add more pointers.
>
> gr. Martin
>
> Austin Teng wrote:
>> Although the new documentation (1) offers a good example of a CDO
>> Hibernate Store running within Eclipse, I can't seem to find one for a
>> standalone server (non-OSGi). I've read that this is supported (2).
>> Has anyone gotten this working that can provide some insight?
>>
>> Or barring that, is there an easy way to deploy an OSGi-based
>> application in a server environment? I suppose it would be similar to
>> an RCP app, but headless.
>>
>> Thanks in advance,
>> Austin
>>
>> (1) http://wiki.eclipse.org/CDO_Hibernate_Store
>> (2) Server Side Features: http://wiki.eclipse.org/CDO
>
>
Re: [CDO Teneo] Hibernate Store standalone server example? [message #509727 is a reply to message #509702] Mon, 25 January 2010 08:30 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Austin,
Yes, this was one open topic in the wiki (how to generate the hbm programmatically and use it). I will add it. I will
probably add it to this page in the wiki:
http://wiki.eclipse.org/CDO_Hibernate_Store_Configuration_an d_Setup
If you are eager for the last updates on the wiki... You can watch the pages in the wiki for changes (be sure to also
set your preferences to send email on wiki changes). There are not that many pages on the Hibernate Store (about 10) so
you can also watch them all :-).

The unsaved-value is taken from the default value for the eattribute or its edatatype. In this case the default value is
an empty string so you can try to set it back to null, then it will be removed from the mapping. This needs to be done
in the model and not in the generated code (and after the change you have to regenerate the code, also as CDO stores in
the model in the db you have to start with a new db...).
Note that the standard EMF ecore editor does not allow me to set a default value from empty string to null, it will keep
the empty string there. So in my case I had to manually change the textual version of the ecore file and remove the
default value attribute from the eattribute.

gr. Martin

Austin Teng wrote:
> I'm not using Spring, but I'll see what I can take from it. Thanks.
>
> I've run into something else that has me stumped. I'm trying to correct
> the following error I get when attempting to save my model:
>
> [ERROR] Row was updated or deleted by another transaction (or
> unsaved-value mapping was incorrect)
>
> Hibernate is trying to update a table when it should be doing an insert
> (the object hasn't been persisted yet).
>
> I've assigning a pre-generated ID to the object being saved (whose ID is
> mapped to the primary key) before being saved, which is causing
> Hibernate to treat the object as if it already exists in the database
> (thus update instead of insert).
>
> The dynamically generated hibernate-mapping contains the following:
>
> <id name="id" type="java.lang.String" unsaved-value="">
> <column not-null="true" unique="false" name="`id`"/>
> </id>
>
> But, I believe it should be something more like this:
>
> <id name="id" type="java.lang.String">
> <column not-null="true" unique="false" name="`id`"/>
> <generator class="assigned"/>
> </id>
>
> Is it still possible to force Teneo to use the Hibernate mapping file
> with CDO? I've tried setting the following property in the
> cdo-server.xml config file...
>
> <property name="teneo.mapping.use_mapping_file" value="true"/>
>
> ....but it doesn't seem to actually honor the entry. There is some
> documentation on it on elver.org, but I assume it's out of date compared
> to the new documentation.
>
> Can you point me in the right direction?
>
> Thanks again,
> Austin
>
>
> On 1/24/10 3:31 PM, Martin Taal wrote:
>> Hi Austin,
>> I am not sure if this answers your question but have you checked out
>> this part of the documentation:
>> http://wiki.eclipse.org/User_Contributed_CDO_Documentation#S nippets
>> and then specifically the spring-wired docs.
>>
>> Maybe Eike or others can add more pointers.
>>
>> gr. Martin
>>
>> Austin Teng wrote:
>>> Although the new documentation (1) offers a good example of a CDO
>>> Hibernate Store running within Eclipse, I can't seem to find one for a
>>> standalone server (non-OSGi). I've read that this is supported (2).
>>> Has anyone gotten this working that can provide some insight?
>>>
>>> Or barring that, is there an easy way to deploy an OSGi-based
>>> application in a server environment? I suppose it would be similar to
>>> an RCP app, but headless.
>>>
>>> Thanks in advance,
>>> Austin
>>>
>>> (1) http://wiki.eclipse.org/CDO_Hibernate_Store
>>> (2) Server Side Features: http://wiki.eclipse.org/CDO
>>
>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [CDO Teneo] Hibernate Store standalone server example? [message #509744 is a reply to message #509691] Mon, 25 January 2010 09:42 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6450
Registered: July 2009
Senior Member
Hi Austin,

Comments below...


Austin Teng schrieb:
> Although the new documentation (1) offers a good example of a CDO
> Hibernate Store running within Eclipse, I can't seem to find one for a
> standalone server (non-OSGi). I've read that this is supported (2).
> Has anyone gotten this working that can provide some insight?
The tests plugin contains an example class
org.eclipse.emf.cdo.tests.ImportXML that shows how to set up a
standalone repository and acceptor.

>
> Or barring that, is there an easy way to deploy an OSGi-based
> application in a server environment? I suppose it would be similar to
> an RCP app, but headless.
Exactly.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO Teneo] Hibernate Store standalone server example? [message #509776 is a reply to message #509702] Mon, 25 January 2010 11:24 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Austin,
I added a piece on using a generated hbm file in the CDO store in the wiki:
http://wiki.eclipse.org/CDO_Hibernate_Store_Model_Relational _Mapping#Generating_the_mapping.2C_manually_changing_it_and_ then_use_the_manual_mapping

(the url is quite long so it will maybe be line-broken in the post).

gr. Martin

Austin Teng wrote:
> I'm not using Spring, but I'll see what I can take from it. Thanks.
>
> I've run into something else that has me stumped. I'm trying to correct
> the following error I get when attempting to save my model:
>
> [ERROR] Row was updated or deleted by another transaction (or
> unsaved-value mapping was incorrect)
>
> Hibernate is trying to update a table when it should be doing an insert
> (the object hasn't been persisted yet).
>
> I've assigning a pre-generated ID to the object being saved (whose ID is
> mapped to the primary key) before being saved, which is causing
> Hibernate to treat the object as if it already exists in the database
> (thus update instead of insert).
>
> The dynamically generated hibernate-mapping contains the following:
>
> <id name="id" type="java.lang.String" unsaved-value="">
> <column not-null="true" unique="false" name="`id`"/>
> </id>
>
> But, I believe it should be something more like this:
>
> <id name="id" type="java.lang.String">
> <column not-null="true" unique="false" name="`id`"/>
> <generator class="assigned"/>
> </id>
>
> Is it still possible to force Teneo to use the Hibernate mapping file
> with CDO? I've tried setting the following property in the
> cdo-server.xml config file...
>
> <property name="teneo.mapping.use_mapping_file" value="true"/>
>
> ....but it doesn't seem to actually honor the entry. There is some
> documentation on it on elver.org, but I assume it's out of date compared
> to the new documentation.
>
> Can you point me in the right direction?
>
> Thanks again,
> Austin
>
>
> On 1/24/10 3:31 PM, Martin Taal wrote:
>> Hi Austin,
>> I am not sure if this answers your question but have you checked out
>> this part of the documentation:
>> http://wiki.eclipse.org/User_Contributed_CDO_Documentation#S nippets
>> and then specifically the spring-wired docs.
>>
>> Maybe Eike or others can add more pointers.
>>
>> gr. Martin
>>
>> Austin Teng wrote:
>>> Although the new documentation (1) offers a good example of a CDO
>>> Hibernate Store running within Eclipse, I can't seem to find one for a
>>> standalone server (non-OSGi). I've read that this is supported (2).
>>> Has anyone gotten this working that can provide some insight?
>>>
>>> Or barring that, is there an easy way to deploy an OSGi-based
>>> application in a server environment? I suppose it would be similar to
>>> an RCP app, but headless.
>>>
>>> Thanks in advance,
>>> Austin
>>>
>>> (1) http://wiki.eclipse.org/CDO_Hibernate_Store
>>> (2) Server Side Features: http://wiki.eclipse.org/CDO
>>
>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [CDO Teneo] Hibernate Store standalone server example? [message #509818 is a reply to message #509744] Mon, 25 January 2010 09:24 Go to previous message
Eclipse UserFriend
Originally posted by: austin.teng.siemens.com

Thanks, Eike. I'll take a look this morning.

On 1/25/10 3:42 AM, Eike Stepper wrote:
> Hi Austin,
>
> Comments below...
>
>
> Austin Teng schrieb:
>> Although the new documentation (1) offers a good example of a CDO
>> Hibernate Store running within Eclipse, I can't seem to find one for a
>> standalone server (non-OSGi). I've read that this is supported (2).
>> Has anyone gotten this working that can provide some insight?
> The tests plugin contains an example class
> org.eclipse.emf.cdo.tests.ImportXML that shows how to set up a
> standalone repository and acceptor.
>
>>
>> Or barring that, is there an easy way to deploy an OSGi-based
>> application in a server environment? I suppose it would be similar to
>> an RCP app, but headless.
> Exactly.
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
Re: [CDO Teneo] Hibernate Store standalone server example? [message #509819 is a reply to message #509776] Mon, 25 January 2010 09:24 Go to previous message
Eclipse UserFriend
Originally posted by: austin.teng.siemens.com

Perfect. I'll give it a shot later once I'm in the office.

Many thanks,
Austin


On 1/25/10 5:24 AM, Martin Taal wrote:
> Hi Austin,
> I added a piece on using a generated hbm file in the CDO store in the wiki:
> http://wiki.eclipse.org/CDO_Hibernate_Store_Model_Relational _Mapping#Generating_the_mapping.2C_manually_changing_it_and_ then_use_the_manual_mapping
>
>
> (the url is quite long so it will maybe be line-broken in the post).
>
> gr. Martin
>
> Austin Teng wrote:
>> I'm not using Spring, but I'll see what I can take from it. Thanks.
>>
>> I've run into something else that has me stumped. I'm trying to
>> correct the following error I get when attempting to save my model:
>>
>> [ERROR] Row was updated or deleted by another transaction (or
>> unsaved-value mapping was incorrect)
>>
>> Hibernate is trying to update a table when it should be doing an
>> insert (the object hasn't been persisted yet).
>>
>> I've assigning a pre-generated ID to the object being saved (whose ID
>> is mapped to the primary key) before being saved, which is causing
>> Hibernate to treat the object as if it already exists in the database
>> (thus update instead of insert).
>>
>> The dynamically generated hibernate-mapping contains the following:
>>
>> <id name="id" type="java.lang.String" unsaved-value="">
>> <column not-null="true" unique="false" name="`id`"/>
>> </id>
>>
>> But, I believe it should be something more like this:
>>
>> <id name="id" type="java.lang.String">
>> <column not-null="true" unique="false" name="`id`"/>
>> <generator class="assigned"/>
>> </id>
>>
>> Is it still possible to force Teneo to use the Hibernate mapping file
>> with CDO? I've tried setting the following property in the
>> cdo-server.xml config file...
>>
>> <property name="teneo.mapping.use_mapping_file" value="true"/>
>>
>> ....but it doesn't seem to actually honor the entry. There is some
>> documentation on it on elver.org, but I assume it's out of date
>> compared to the new documentation.
>>
>> Can you point me in the right direction?
>>
>> Thanks again,
>> Austin
>>
>>
>> On 1/24/10 3:31 PM, Martin Taal wrote:
>>> Hi Austin,
>>> I am not sure if this answers your question but have you checked out
>>> this part of the documentation:
>>> http://wiki.eclipse.org/User_Contributed_CDO_Documentation#S nippets
>>> and then specifically the spring-wired docs.
>>>
>>> Maybe Eike or others can add more pointers.
>>>
>>> gr. Martin
>>>
>>> Austin Teng wrote:
>>>> Although the new documentation (1) offers a good example of a CDO
>>>> Hibernate Store running within Eclipse, I can't seem to find one for a
>>>> standalone server (non-OSGi). I've read that this is supported (2).
>>>> Has anyone gotten this working that can provide some insight?
>>>>
>>>> Or barring that, is there an easy way to deploy an OSGi-based
>>>> application in a server environment? I suppose it would be similar to
>>>> an RCP app, but headless.
>>>>
>>>> Thanks in advance,
>>>> Austin
>>>>
>>>> (1) http://wiki.eclipse.org/CDO_Hibernate_Store
>>>> (2) Server Side Features: http://wiki.eclipse.org/CDO
>>>
>>>
>>
>
>
Previous Topic:NullPointer at org.eclipse.emf.common.EMFPlugin$InternalHelper.log(EMFPlugin.java:736)
Next Topic:[CDO Teneo] Cannot start a CDO Server with a Hibernate Datastore using a Derby Database
Goto Forum:
  


Current Time: Thu Nov 14 06:32:22 GMT 2019

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

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

Back to the top