Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Trying to use the timestamp in a legacy database as the optimistic locking column
[Teneo] Trying to use the timestamp in a legacy database as the optimistic locking column [message #425402] Mon, 24 November 2008 23:29 Go to next message
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
Hi all,

We have a scenario like this:

<xsd:attribute
name="informationSystemsDeptLastUpdateStamp"
type="xsd:string">
<xsd:annotation><xsd:appinfo source="teneo.jpa">
@Version
@Column(nullable="false" name="ISD_LUPD_TS" )
</xsd:appinfo></xsd:annotation>
</xsd:attribute>


ISD_LUPD_TS is actually a timestamp column in the database. In this
example, we're saying it's a string, but we've also tried timestamp.
The problem we get is an exception that looks like this:

Caused by: java.lang.ClassCastException: org.hibernate.type.StringType
incompatible with org.hibernate.type.VersionType
at
org.hibernate.tuple.PropertyFactory.buildVersionProperty(Pro pertyFactory.java:84)
at
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:170)
at
org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:434)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:109)
at
org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:55)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1300)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:162)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:82)
at
com.vsp.soap.util.VSPServiceSoapUtil.getDataStore(VSPService SoapUtil.java:227)
at com.vsp.soap.util.VSPServiceSoapUtil.<init>(VSPServiceSoapUtil.java:160)

Is there anything we should be doing differently? Should it really be a
timestamp type and maybe we did something else wrong?

Thanks for any ideas,

Jason Henriksen
Re: [Teneo] Trying to use the timestamp in a legacy database as the optimistic locking column [message #425403 is a reply to message #425402] Mon, 24 November 2008 23:46 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Jason,
Hibernate only supports timestap/numeric version properties. What exception do you get when setting
the eattribute to timestamp?

gr. Martin

jason henriksen wrote:
>
> Hi all,
>
> We have a scenario like this:
>
> <xsd:attribute
> name="informationSystemsDeptLastUpdateStamp"
> type="xsd:string">
> <xsd:annotation><xsd:appinfo source="teneo.jpa">
> @Version
> @Column(nullable="false" name="ISD_LUPD_TS" )
> </xsd:appinfo></xsd:annotation>
> </xsd:attribute>
>
>
> ISD_LUPD_TS is actually a timestamp column in the database. In this
> example, we're saying it's a string, but we've also tried timestamp. The
> problem we get is an exception that looks like this:
>
> Caused by: java.lang.ClassCastException: org.hibernate.type.StringType
> incompatible with org.hibernate.type.VersionType
> at
> org.hibernate.tuple.PropertyFactory.buildVersionProperty(Pro pertyFactory.java:84)
>
> at
> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:170)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:434)
>
> at
> org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:109)
>
> at
> org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:55)
>
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1300)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:162)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:82)
>
> at
> com.vsp.soap.util.VSPServiceSoapUtil.getDataStore(VSPService SoapUtil.java:227)
>
> at
> com.vsp.soap.util.VSPServiceSoapUtil.<init>(VSPServiceSoapUtil.java:160)
>
> Is there anything we should be doing differently? Should it really be a
> timestamp type and maybe we did something else wrong?
>
> Thanks for any ideas,
>
> Jason Henriksen


--

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
Previous Topic:getChildrenFeatures generation in ItemProviderAdapter
Next Topic:[CDO] Historical states
Goto Forum:
  


Current Time: Thu May 28 02:41:56 GMT 2020

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

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

Back to the top