Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO/Teneo] Data type error with H2 support
[CDO/Teneo] Data type error with H2 support [message #659387] Sun, 13 March 2011 13:10 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

Since DbStore has ancient H2 version support thought I'd try Teneo
Hibernate support for H2. I cannot use this long term as we must have
CDO Revision support on one hand, but on the other we have had so many
exceptions trying to get CDO DbStore to work on Win XP it is difficult.

Here is my cdo-server section for the H2

<!-- Setting for h2
-->
<property name="hibernate.dialect"
value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.driver_class"
value="org.h2.Driver"/>
<property name="hibernate.connection.url"
value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>


And the relevant part of my annotation

<eclass name="Resource">
<property name="content">
<lob />
<column length="1048576" />
</property>
</eclass>


[ERROR] INTEGER
java.lang.NoSuchFieldError: INTEGER
at
org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
at
org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
at org.hibernate.loader.Loader.getRow(Loader.java:1355)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
at org.hibernate.loader.Loader.doQuery(Loader.java:829)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
at
org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
at
org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
at
org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
at
org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
at org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
at org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
at
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
at
org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
at org.hibernate.loader.Loader.doQuery(Loader.java:857)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)

Ideas?

Thx.

David
Re: [CDO/Teneo] Data type error with H2 support [message #659392 is a reply to message #659387] Sun, 13 March 2011 15:09 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
I see my problem now, I have most of my projects using Teneo 1.2.0 (i.e.
1.1.2, confusing, yes) with Hibernate 3.6.0, and having selected all
plugins, it picked up that hibernate 3.6 plugin I put together.

I realize it is pointless pursuing this path due to the lack of audit
and revision support, so will try to sort out DbStore instead.

Thx.

David

On 13/03/11 13:10, David Wynter wrote:
> Hi,
>
> Since DbStore has ancient H2 version support thought I'd try Teneo
> Hibernate support for H2. I cannot use this long term as we must have
> CDO Revision support on one hand, but on the other we have had so many
> exceptions trying to get CDO DbStore to work on Win XP it is difficult.
>
> Here is my cdo-server section for the H2
>
> <!-- Setting for h2
> -->
> <property name="hibernate.dialect"
> value="org.hibernate.dialect.H2Dialect"/>
> <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
> <property name="hibernate.connection.url"
> value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>
>
>
>
> And the relevant part of my annotation
>
> <eclass name="Resource">
> <property name="content">
> <lob />
> <column length="1048576" />
> </property>
> </eclass>
>
>
> [ERROR] INTEGER
> java.lang.NoSuchFieldError: INTEGER
> at
> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
>
> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
>
> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>
> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
> at
> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
>
> at
> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
>
> at
> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
>
> at
> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
> at org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
> at org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
> at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
> at
> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
> at
> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
>
> at org.hibernate.loader.Loader.doQuery(Loader.java:857)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>
> at org.hibernate.loader.Loader.doList(Loader.java:2533)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
> at org.hibernate.loader.Loader.list(Loader.java:2271)
> at
> org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
> at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)
>
>
> Ideas?
>
> Thx.
>
> David
Re: [CDO/Teneo] Data type error with H2 support [message #659423 is a reply to message #659387] Sun, 13 March 2011 18:40 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 13.03.2011 14:10, schrieb David Wynter:
> Hi,
>
> Since DbStore has ancient H2 version support
Not sure how you mean that, but it's technically not correct, IMHO.

CDO's DBStore has no knowledge about any particular DB vendor, it only knows about general JDBC. It does make use of specific Net4j DBAdapters through the interface IDBAdapter. Then there is the particular H2Adapter, which actually depends on the Java packages exported from a H2 JDBC driver distribution (bundle). These Java packages must be in the version range [1.0.0,2.0.0), which covers the most recent versions I'm seeing on http://www.h2database.com/html/main.html .

The only thing that *may* be ancient is the H2 version 1.1.117 distributed by the Orbit project: http://download.eclipse.org/tools/orbit/downloads/drops/S201 10304120314/ . But that's not in our scope and you're free to deploy any bundle instead that exports the H2 packages in the version range [1.0.0,2.0.0).

Here is a diagram of the actual architecture: http://dev.eclipse.org/mhonarc/lists/modeling-pmc/pngGWSdayo Itf.png

You may not care (although Eclipse Legal keeps telling me that users do care), but even for these so called "optional / works-with" dependencies (those that we not even redistribute ourselves) we need to specifiy a single *exact* version number when we apply for a legal approval. So the effort to keep up with the external development is so high that we can't afford it for all the DB types that we support. I'm not sure where there is the right forum to complain about these picky processes, but as long as I'm the only person complaining about this certainly nothing will change.

> thought I'd try Teneo Hibernate support for H2. I cannot use this long term as we must have CDO Revision support on one hand, but on the other we have had so many exceptions trying to get CDO DbStore to work on Win XP it is difficult.
What exceptions? Although I'm not the responsible for the DBStore I'm also not aware of any bugzillas that might be related. Most users report that they're very happy with the DBStore.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Here is my cdo-server section for the H2
>
> <!-- Setting for h2
> -->
> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
> <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
> <property name="hibernate.connection.url" value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>
>
>
> And the relevant part of my annotation
>
> <eclass name="Resource">
> <property name="content">
> <lob />
> <column length="1048576" />
> </property>
> </eclass>
>
>
> [ERROR] INTEGER
> java.lang.NoSuchFieldError: INTEGER
> at org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
> at org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
> at org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
> at org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
> at org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
> at org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
> at org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
> at org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
> at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
> at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
> at org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
> at org.hibernate.loader.Loader.doQuery(Loader.java:857)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
> at org.hibernate.loader.Loader.doList(Loader.java:2533)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
> at org.hibernate.loader.Loader.list(Loader.java:2271)
> at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
> at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
> at org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)
>
> Ideas?
>
> Thx.
>
> David


Re: [CDO/Teneo] Data type error with H2 support [message #659498 is a reply to message #659423] Mon, 14 March 2011 10:31 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

I am referring to H2 1.1.117, V 1.3.153 is about to be released and has
hundreds of changes and bug fixes since 1.1.117, so of course it is of
interest. It took me a while to realise I can just simply do my own H2
plugin, your arch diagram made this simple to understand, thx.

The real frustration is that it has stalled a development using XText
where our model is in CDO. Sonme referenc eis here
http://www.eclipse.org/forums/index.php?t=msg&th=205902& amp;start=0&S=2941cbc188616abb91cd0a500e855e79

I have everything working fine once we worked our the multi step process
for setting up a repo (including altering a table to have a column as a
CLOB). But since the other developer uses Windoze XP and not Linux and
the fact that despite hours of trying every combination, we cannot get
my repo onto his PC.

I have asked him to document exactly the steps he takes and the
exception he gets when we use the "Build the repo from scratch and
import my Resource" method. We also tried copying across a already
loaded repo and connecting to that, but that has different exceptions.

Here are the steps we follow:

0. Setup a cdo-server.xml for Derby
1. Open the repo using CDO Explorer, then register the ecore model from
the workspace once I had attached to the repo
2. Start a Transaction
3. Add a Resource, commit and open in the editor.
4. Exit CD Explorer, open the Derby Db in a SQL client and alter our
model table.column RESOURCE.CONTENT to CLOB(1000000), exit.
5. Re open CDO Explorer and attach to the repo, makes sure you register
our model again, start a Transaction and open our resource and in the
editor right click and select Import Roots...
6. Select your model file and click OK, wait until it finishes,
7. Right click the Transaction in CDO Sessions and commit.

At any point in CDO Explorer if you miss a step or make a mistake, you
MUST exit Eclipse and start again, including deleting the Derby database
directory, otherwise different exceptions are thrown.

I don't have his exception to hand and he is not online, so will ask him
to follow up.

Thx.

David
On 13/03/11 18:40, Eike Stepper wrote:
> Am 13.03.2011 14:10, schrieb David Wynter:
>> Hi,
>>
>> Since DbStore has ancient H2 version support
> Not sure how you mean that, but it's technically not correct, IMHO.
>
> CDO's DBStore has no knowledge about any particular DB vendor, it only
> knows about general JDBC. It does make use of specific Net4j DBAdapters
> through the interface IDBAdapter. Then there is the particular
> H2Adapter, which actually depends on the Java packages exported from a
> H2 JDBC driver distribution (bundle). These Java packages must be in the
> version range [1.0.0,2.0.0), which covers the most recent versions I'm
> seeing on http://www.h2database.com/html/main.html .
>
> The only thing that *may* be ancient is the H2 version 1.1.117
> distributed by the Orbit project:
> http://download.eclipse.org/tools/orbit/downloads/drops/S201 10304120314/
> . But that's not in our scope and you're free to deploy any bundle
> instead that exports the H2 packages in the version range [1.0.0,2.0.0).
>
> Here is a diagram of the actual architecture:
> http://dev.eclipse.org/mhonarc/lists/modeling-pmc/pngGWSdayo Itf.png
>
> You may not care (although Eclipse Legal keeps telling me that users do
> care), but even for these so called "optional / works-with" dependencies
> (those that we not even redistribute ourselves) we need to specifiy a
> single *exact* version number when we apply for a legal approval. So the
> effort to keep up with the external development is so high that we can't
> afford it for all the DB types that we support. I'm not sure where there
> is the right forum to complain about these picky processes, but as long
> as I'm the only person complaining about this certainly nothing will
> change.
>
>> thought I'd try Teneo Hibernate support for H2. I cannot use this long
>> term as we must have CDO Revision support on one hand, but on the
>> other we have had so many exceptions trying to get CDO DbStore to work
>> on Win XP it is difficult.
> What exceptions? Although I'm not the responsible for the DBStore I'm
> also not aware of any bugzillas that might be related. Most users report
> that they're very happy with the DBStore.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Here is my cdo-server section for the H2
>>
>> <!-- Setting for h2
>> -->
>> <property name="hibernate.dialect"
>> value="org.hibernate.dialect.H2Dialect"/>
>> <property name="hibernate.connection.driver_class"
>> value="org.h2.Driver"/>
>> <property name="hibernate.connection.url"
>> value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>
>>
>>
>>
>> And the relevant part of my annotation
>>
>> <eclass name="Resource">
>> <property name="content">
>> <lob />
>> <column length="1048576" />
>> </property>
>> </eclass>
>>
>>
>> [ERROR] INTEGER
>> java.lang.NoSuchFieldError: INTEGER
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
>>
>> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
>> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
>>
>> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
>> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
>> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
>> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
>> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
>> at
>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>
>> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
>> at
>> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
>>
>> at
>> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
>>
>> at
>> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
>>
>> at
>> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
>>
>> at
>> org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
>> at org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
>> at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
>> at
>> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
>> at
>> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
>>
>> at org.hibernate.loader.Loader.doQuery(Loader.java:857)
>> at
>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>
>> at org.hibernate.loader.Loader.doList(Loader.java:2533)
>> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
>> at org.hibernate.loader.Loader.list(Loader.java:2271)
>> at
>> org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
>>
>> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
>> at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)
>>
>>
>> Ideas?
>>
>> Thx.
>>
>> David
Re: [CDO/Teneo] Data type error with H2 support [message #659502 is a reply to message #659498] Mon, 14 March 2011 10:50 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 14.03.2011 11:31, schrieb David Wynter:
> Hi,
>
> I am referring to H2 1.1.117, V 1.3.153 is about to be released and has hundreds of changes and bug fixes since 1.1.117, so of course it is of interest. It took me a while to realise I can just simply do my own H2 plugin, your arch diagram made this simple to understand, thx.
>
> The real frustration is that it has stalled a development using XText where our model is in CDO. Sonme referenc eis here http://www.eclipse.org/forums/index.php?t=msg&th=205902& amp;start=0&S=2941cbc188616abb91cd0a500e855e79
>
> I have everything working fine once we worked our the multi step process for setting up a repo (including altering a table to have a column as a CLOB).
Maybe this artile helps: http://wiki.eclipse.org/Influence_DB_Store_mapping_by_using_ annotations

> But since the other developer uses Windoze XP and not Linux and the fact that despite hours of trying every combination, we cannot get my repo onto his PC.
Doesn't H2 have an SQL dump/import mechansim?

>
> I have asked him to document exactly the steps he takes and the exception he gets when we use the "Build the repo from scratch and import my Resource" method. We also tried copying across a already loaded repo and connecting to that, but that has different exceptions.
>
> Here are the steps we follow:
>
> 0. Setup a cdo-server.xml for Derby
Note that Derby is comparingly slow.

> 1. Open the repo using CDO Explorer, then register the ecore model from the workspace once I had attached to the repo
Why not the generated model?

> 2. Start a Transaction
> 3. Add a Resource, commit and open in the editor.
> 4. Exit CD Explorer, open the Derby Db in a SQL client and alter our model table.column RESOURCE.CONTENT to CLOB(1000000), exit.
> 5. Re open CDO Explorer and attach to the repo, makes sure you register our model again,
Shouldn't be needed if you used a generated model.

> start a Transaction and open our resource and in the editor right click and select Import Roots...
Importing multiple resources is always tricky because of potential cross-references. Maybe there's a bug.

> 6. Select your model file and click OK, wait until it finishes,
> 7. Right click the Transaction in CDO Sessions and commit.
>
> At any point in CDO Explorer if you miss a step or make a mistake, you MUST exit Eclipse and start again, including deleting the Derby database directory, otherwise different exceptions are thrown.
>
> I don't have his exception to hand and he is not online, so will ask him to follow up.
Yeah, that exact info would be needed needed for a bugzilla ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thx.
>
> David
> On 13/03/11 18:40, Eike Stepper wrote:
>> Am 13.03.2011 14:10, schrieb David Wynter:
>>> Hi,
>>>
>>> Since DbStore has ancient H2 version support
>> Not sure how you mean that, but it's technically not correct, IMHO.
>>
>> CDO's DBStore has no knowledge about any particular DB vendor, it only
>> knows about general JDBC. It does make use of specific Net4j DBAdapters
>> through the interface IDBAdapter. Then there is the particular
>> H2Adapter, which actually depends on the Java packages exported from a
>> H2 JDBC driver distribution (bundle). These Java packages must be in the
>> version range [1.0.0,2.0.0), which covers the most recent versions I'm
>> seeing on http://www.h2database.com/html/main.html .
>>
>> The only thing that *may* be ancient is the H2 version 1.1.117
>> distributed by the Orbit project:
>> http://download.eclipse.org/tools/orbit/downloads/drops/S201 10304120314/
>> . But that's not in our scope and you're free to deploy any bundle
>> instead that exports the H2 packages in the version range [1.0.0,2.0.0).
>>
>> Here is a diagram of the actual architecture:
>> http://dev.eclipse.org/mhonarc/lists/modeling-pmc/pngGWSdayo Itf.png
>>
>> You may not care (although Eclipse Legal keeps telling me that users do
>> care), but even for these so called "optional / works-with" dependencies
>> (those that we not even redistribute ourselves) we need to specifiy a
>> single *exact* version number when we apply for a legal approval. So the
>> effort to keep up with the external development is so high that we can't
>> afford it for all the DB types that we support. I'm not sure where there
>> is the right forum to complain about these picky processes, but as long
>> as I'm the only person complaining about this certainly nothing will
>> change.
>>
>>> thought I'd try Teneo Hibernate support for H2. I cannot use this long
>>> term as we must have CDO Revision support on one hand, but on the
>>> other we have had so many exceptions trying to get CDO DbStore to work
>>> on Win XP it is difficult.
>> What exceptions? Although I'm not the responsible for the DBStore I'm
>> also not aware of any bugzillas that might be related. Most users report
>> that they're very happy with the DBStore.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> Here is my cdo-server section for the H2
>>>
>>> <!-- Setting for h2
>>> -->
>>> <property name="hibernate.dialect"
>>> value="org.hibernate.dialect.H2Dialect"/>
>>> <property name="hibernate.connection.driver_class"
>>> value="org.h2.Driver"/>
>>> <property name="hibernate.connection.url"
>>> value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>
>>>
>>>
>>>
>>> And the relevant part of my annotation
>>>
>>> <eclass name="Resource">
>>> <property name="content">
>>> <lob />
>>> <column length="1048576" />
>>> </property>
>>> </eclass>
>>>
>>>
>>> [ERROR] INTEGER
>>> java.lang.NoSuchFieldError: INTEGER
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
>>>
>>> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
>>> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
>>>
>>> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
>>> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
>>> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
>>> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
>>> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
>>> at
>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>
>>> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
>>> at
>>> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
>>>
>>> at
>>> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
>>>
>>> at
>>> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
>>>
>>> at
>>> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
>>>
>>> at
>>> org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
>>> at org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
>>> at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
>>> at
>>> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
>>> at
>>> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
>>>
>>> at org.hibernate.loader.Loader.doQuery(Loader.java:857)
>>> at
>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>
>>> at org.hibernate.loader.Loader.doList(Loader.java:2533)
>>> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
>>> at org.hibernate.loader.Loader.list(Loader.java:2271)
>>> at
>>> org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
>>>
>>> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
>>> at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)
>>>
>>>
>>> Ideas?
>>>
>>> Thx.
>>>
>>> David
>


Re: [CDO/Teneo] Data type error with H2 support [message #659516 is a reply to message #659502] Mon, 14 March 2011 12:05 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Eike,

You say below "Why not the generated model?" I am not sure what you mean
by this, we have a genmodel generated with the CDO Native option. I did
not find an example or tutorial on how this might alter the need to
register the model we have every time we open the CDO Explorer tool? Is
there a way of using the genmodel file to prevent this?

And btw we went for the lowest common denominator, we use Derby, until
we have a reliable way of Importing and Exporting resources, then I'll
tackle my issue with H2 newer version support.

Thx.

David

On 14/03/11 10:50, Eike Stepper wrote:
> Am 14.03.2011 11:31, schrieb David Wynter:
>> Hi,
>>
>> I am referring to H2 1.1.117, V 1.3.153 is about to be released and
>> has hundreds of changes and bug fixes since 1.1.117, so of course it
>> is of interest. It took me a while to realise I can just simply do my
>> own H2 plugin, your arch diagram made this simple to understand, thx.
>>
>> The real frustration is that it has stalled a development using XText
>> where our model is in CDO. Sonme referenc eis here
>> http://www.eclipse.org/forums/index.php?t=msg&th=205902& amp;start=0&S=2941cbc188616abb91cd0a500e855e79
>>
>>
>> I have everything working fine once we worked our the multi step
>> process for setting up a repo (including altering a table to have a
>> column as a CLOB).
> Maybe this artile helps:
> http://wiki.eclipse.org/Influence_DB_Store_mapping_by_using_ annotations
>
>> But since the other developer uses Windoze XP and not Linux and the
>> fact that despite hours of trying every combination, we cannot get my
>> repo onto his PC.
> Doesn't H2 have an SQL dump/import mechansim?
>
>>
>> I have asked him to document exactly the steps he takes and the
>> exception he gets when we use the "Build the repo from scratch and
>> import my Resource" method. We also tried copying across a already
>> loaded repo and connecting to that, but that has different exceptions.
>>
>> Here are the steps we follow:
>>
>> 0. Setup a cdo-server.xml for Derby
> Note that Derby is comparingly slow.
>
>> 1. Open the repo using CDO Explorer, then register the ecore model
>> from the workspace once I had attached to the repo
> Why not the generated model?
>
>> 2. Start a Transaction
>> 3. Add a Resource, commit and open in the editor.
>> 4. Exit CD Explorer, open the Derby Db in a SQL client and alter our
>> model table.column RESOURCE.CONTENT to CLOB(1000000), exit.
>> 5. Re open CDO Explorer and attach to the repo, makes sure you
>> register our model again,
> Shouldn't be needed if you used a generated model.
>
>> start a Transaction and open our resource and in the editor right
>> click and select Import Roots...
> Importing multiple resources is always tricky because of potential
> cross-references. Maybe there's a bug.
>
>> 6. Select your model file and click OK, wait until it finishes,
>> 7. Right click the Transaction in CDO Sessions and commit.
>>
>> At any point in CDO Explorer if you miss a step or make a mistake, you
>> MUST exit Eclipse and start again, including deleting the Derby
>> database directory, otherwise different exceptions are thrown.
>>
>> I don't have his exception to hand and he is not online, so will ask
>> him to follow up.
> Yeah, that exact info would be needed needed for a bugzilla ;-)
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Thx.
>>
>> David
>> On 13/03/11 18:40, Eike Stepper wrote:
>>> Am 13.03.2011 14:10, schrieb David Wynter:
>>>> Hi,
>>>>
>>>> Since DbStore has ancient H2 version support
>>> Not sure how you mean that, but it's technically not correct, IMHO.
>>>
>>> CDO's DBStore has no knowledge about any particular DB vendor, it only
>>> knows about general JDBC. It does make use of specific Net4j DBAdapters
>>> through the interface IDBAdapter. Then there is the particular
>>> H2Adapter, which actually depends on the Java packages exported from a
>>> H2 JDBC driver distribution (bundle). These Java packages must be in the
>>> version range [1.0.0,2.0.0), which covers the most recent versions I'm
>>> seeing on http://www.h2database.com/html/main.html .
>>>
>>> The only thing that *may* be ancient is the H2 version 1.1.117
>>> distributed by the Orbit project:
>>> http://download.eclipse.org/tools/orbit/downloads/drops/S201 10304120314/
>>> . But that's not in our scope and you're free to deploy any bundle
>>> instead that exports the H2 packages in the version range [1.0.0,2.0.0).
>>>
>>> Here is a diagram of the actual architecture:
>>> http://dev.eclipse.org/mhonarc/lists/modeling-pmc/pngGWSdayo Itf.png
>>>
>>> You may not care (although Eclipse Legal keeps telling me that users do
>>> care), but even for these so called "optional / works-with" dependencies
>>> (those that we not even redistribute ourselves) we need to specifiy a
>>> single *exact* version number when we apply for a legal approval. So the
>>> effort to keep up with the external development is so high that we can't
>>> afford it for all the DB types that we support. I'm not sure where there
>>> is the right forum to complain about these picky processes, but as long
>>> as I'm the only person complaining about this certainly nothing will
>>> change.
>>>
>>>> thought I'd try Teneo Hibernate support for H2. I cannot use this long
>>>> term as we must have CDO Revision support on one hand, but on the
>>>> other we have had so many exceptions trying to get CDO DbStore to work
>>>> on Win XP it is difficult.
>>> What exceptions? Although I'm not the responsible for the DBStore I'm
>>> also not aware of any bugzillas that might be related. Most users report
>>> that they're very happy with the DBStore.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> Here is my cdo-server section for the H2
>>>>
>>>> <!-- Setting for h2
>>>> -->
>>>> <property name="hibernate.dialect"
>>>> value="org.hibernate.dialect.H2Dialect"/>
>>>> <property name="hibernate.connection.driver_class"
>>>> value="org.h2.Driver"/>
>>>> <property name="hibernate.connection.url"
>>>> value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>
>>>>
>>>>
>>>>
>>>>
>>>> And the relevant part of my annotation
>>>>
>>>> <eclass name="Resource">
>>>> <property name="content">
>>>> <lob />
>>>> <column length="1048576" />
>>>> </property>
>>>> </eclass>
>>>>
>>>>
>>>> [ERROR] INTEGER
>>>> java.lang.NoSuchFieldError: INTEGER
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
>>>>
>>>>
>>>> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
>>>> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
>>>>
>>>>
>>>> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
>>>> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
>>>> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
>>>> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
>>>> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
>>>> at
>>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>>
>>>>
>>>> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
>>>> at
>>>> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
>>>>
>>>>
>>>> at
>>>> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
>>>>
>>>>
>>>> at
>>>> org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
>>>>
>>>> at
>>>> org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
>>>> at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
>>>> at
>>>> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
>>>>
>>>> at
>>>> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
>>>>
>>>>
>>>> at org.hibernate.loader.Loader.doQuery(Loader.java:857)
>>>> at
>>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>>
>>>>
>>>> at org.hibernate.loader.Loader.doList(Loader.java:2533)
>>>> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
>>>> at org.hibernate.loader.Loader.list(Loader.java:2271)
>>>> at
>>>> org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
>>>>
>>>>
>>>> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
>>>> at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)
>>>>
>>>>
>>>>
>>>> Ideas?
>>>>
>>>> Thx.
>>>>
>>>> David
>>
Re: [CDO/Teneo] Data type error with H2 support [message #659525 is a reply to message #659516] Mon, 14 March 2011 12:38 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 14.03.2011 13:05, schrieb David Wynter:
> Eike,
>
> You say below "Why not the generated model?" I am not sure what you mean by this, we have a genmodel generated with the CDO Native option. I did not find an example or tutorial on how this might alter the need to register the model we have every time we open the CDO Explorer tool? Is there a way of using the genmodel file to prevent this?
Please follow http://wiki.eclipse.org/CDO/Preparing_EMF_Models to regenerate your model for CDO and then everything should work automatically and more performant.

>
> And btw we went for the lowest common denominator, we use Derby, until we have a reliable way of Importing and Exporting resources, then I'll tackle my issue with H2 newer version support.
Is there no SQL export/import in H2?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thx.
>
> David
>
> On 14/03/11 10:50, Eike Stepper wrote:
>> Am 14.03.2011 11:31, schrieb David Wynter:
>>> Hi,
>>>
>>> I am referring to H2 1.1.117, V 1.3.153 is about to be released and
>>> has hundreds of changes and bug fixes since 1.1.117, so of course it
>>> is of interest. It took me a while to realise I can just simply do my
>>> own H2 plugin, your arch diagram made this simple to understand, thx.
>>>
>>> The real frustration is that it has stalled a development using XText
>>> where our model is in CDO. Sonme referenc eis here
>>> http://www.eclipse.org/forums/index.php?t=msg&th=205902& amp;start=0&S=2941cbc188616abb91cd0a500e855e79
>>>
>>>
>>> I have everything working fine once we worked our the multi step
>>> process for setting up a repo (including altering a table to have a
>>> column as a CLOB).
>> Maybe this artile helps:
>> http://wiki.eclipse.org/Influence_DB_Store_mapping_by_using_ annotations
>>
>>> But since the other developer uses Windoze XP and not Linux and the
>>> fact that despite hours of trying every combination, we cannot get my
>>> repo onto his PC.
>> Doesn't H2 have an SQL dump/import mechansim?
>>
>>>
>>> I have asked him to document exactly the steps he takes and the
>>> exception he gets when we use the "Build the repo from scratch and
>>> import my Resource" method. We also tried copying across a already
>>> loaded repo and connecting to that, but that has different exceptions.
>>>
>>> Here are the steps we follow:
>>>
>>> 0. Setup a cdo-server.xml for Derby
>> Note that Derby is comparingly slow.
>>
>>> 1. Open the repo using CDO Explorer, then register the ecore model
>>> from the workspace once I had attached to the repo
>> Why not the generated model?
>>
>>> 2. Start a Transaction
>>> 3. Add a Resource, commit and open in the editor.
>>> 4. Exit CD Explorer, open the Derby Db in a SQL client and alter our
>>> model table.column RESOURCE.CONTENT to CLOB(1000000), exit.
>>> 5. Re open CDO Explorer and attach to the repo, makes sure you
>>> register our model again,
>> Shouldn't be needed if you used a generated model.
>>
>>> start a Transaction and open our resource and in the editor right
>>> click and select Import Roots...
>> Importing multiple resources is always tricky because of potential
>> cross-references. Maybe there's a bug.
>>
>>> 6. Select your model file and click OK, wait until it finishes,
>>> 7. Right click the Transaction in CDO Sessions and commit.
>>>
>>> At any point in CDO Explorer if you miss a step or make a mistake, you
>>> MUST exit Eclipse and start again, including deleting the Derby
>>> database directory, otherwise different exceptions are thrown.
>>>
>>> I don't have his exception to hand and he is not online, so will ask
>>> him to follow up.
>> Yeah, that exact info would be needed needed for a bugzilla ;-)
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> Thx.
>>>
>>> David
>>> On 13/03/11 18:40, Eike Stepper wrote:
>>>> Am 13.03.2011 14:10, schrieb David Wynter:
>>>>> Hi,
>>>>>
>>>>> Since DbStore has ancient H2 version support
>>>> Not sure how you mean that, but it's technically not correct, IMHO.
>>>>
>>>> CDO's DBStore has no knowledge about any particular DB vendor, it only
>>>> knows about general JDBC. It does make use of specific Net4j DBAdapters
>>>> through the interface IDBAdapter. Then there is the particular
>>>> H2Adapter, which actually depends on the Java packages exported from a
>>>> H2 JDBC driver distribution (bundle). These Java packages must be in the
>>>> version range [1.0.0,2.0.0), which covers the most recent versions I'm
>>>> seeing on http://www.h2database.com/html/main.html .
>>>>
>>>> The only thing that *may* be ancient is the H2 version 1.1.117
>>>> distributed by the Orbit project:
>>>> http://download.eclipse.org/tools/orbit/downloads/drops/S201 10304120314/
>>>> . But that's not in our scope and you're free to deploy any bundle
>>>> instead that exports the H2 packages in the version range [1.0.0,2.0.0).
>>>>
>>>> Here is a diagram of the actual architecture:
>>>> http://dev.eclipse.org/mhonarc/lists/modeling-pmc/pngGWSdayo Itf.png
>>>>
>>>> You may not care (although Eclipse Legal keeps telling me that users do
>>>> care), but even for these so called "optional / works-with" dependencies
>>>> (those that we not even redistribute ourselves) we need to specifiy a
>>>> single *exact* version number when we apply for a legal approval. So the
>>>> effort to keep up with the external development is so high that we can't
>>>> afford it for all the DB types that we support. I'm not sure where there
>>>> is the right forum to complain about these picky processes, but as long
>>>> as I'm the only person complaining about this certainly nothing will
>>>> change.
>>>>
>>>>> thought I'd try Teneo Hibernate support for H2. I cannot use this long
>>>>> term as we must have CDO Revision support on one hand, but on the
>>>>> other we have had so many exceptions trying to get CDO DbStore to work
>>>>> on Win XP it is difficult.
>>>> What exceptions? Although I'm not the responsible for the DBStore I'm
>>>> also not aware of any bugzillas that might be related. Most users report
>>>> that they're very happy with the DBStore.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> Here is my cdo-server section for the H2
>>>>>
>>>>> <!-- Setting for h2
>>>>> -->
>>>>> <property name="hibernate.dialect"
>>>>> value="org.hibernate.dialect.H2Dialect"/>
>>>>> <property name="hibernate.connection.driver_class"
>>>>> value="org.h2.Driver"/>
>>>>> <property name="hibernate.connection.url"
>>>>> value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> And the relevant part of my annotation
>>>>>
>>>>> <eclass name="Resource">
>>>>> <property name="content">
>>>>> <lob />
>>>>> <column length="1048576" />
>>>>> </property>
>>>>> </eclass>
>>>>>
>>>>>
>>>>> [ERROR] INTEGER
>>>>> java.lang.NoSuchFieldError: INTEGER
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
>>>>>
>>>>>
>>>>> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
>>>>> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
>>>>> at
>>>>> org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
>>>>>
>>>>>
>>>>> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
>>>>> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
>>>>> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
>>>>> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
>>>>> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
>>>>> at
>>>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>>>
>>>>>
>>>>> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
>>>>> at
>>>>> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
>>>>>
>>>>>
>>>>> at
>>>>> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
>>>>>
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
>>>>>
>>>>>
>>>>> at
>>>>> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
>>>>>
>>>>>
>>>>> at
>>>>> org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
>>>>>
>>>>> at
>>>>> org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
>>>>> at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
>>>>> at
>>>>> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
>>>>>
>>>>> at
>>>>> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
>>>>>
>>>>>
>>>>> at org.hibernate.loader.Loader.doQuery(Loader.java:857)
>>>>> at
>>>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>>>
>>>>>
>>>>> at org.hibernate.loader.Loader.doList(Loader.java:2533)
>>>>> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
>>>>> at org.hibernate.loader.Loader.list(Loader.java:2271)
>>>>> at
>>>>> org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
>>>>>
>>>>>
>>>>> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
>>>>> at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)
>>>>>
>>>>>
>>>>>
>>>>> Ideas?
>>>>>
>>>>> Thx.
>>>>>
>>>>> David
>>>
>


Re: [CDO/Teneo] Data type error with H2 support [message #659588 is a reply to message #659525] Mon, 14 March 2011 16:51 Go to previous message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

I always used the tutorial you pointed out below. I still have to
register my ecore everytime I run the CDO Explorer to get it 'properly'
registered. It show in the list of Registered models, but will always
fail with

org.eclipse.emf.cdo.common.util.CDOException: Generated packages locally
not available: CDOPackageUnit[id=http://www.example.com/amodel,
state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=07-Mar-2011
12:07:49:122]
at
org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPack ages(CDOSessionImpl.java:288)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl .load(CDOPackageUnitImpl.java:239)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl .getEPackage(CDOPackageInfoImpl.java:133)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl .getEPackage(CDOPackageInfoImpl.java:120)
....

unless I open the "Register Workspace Packages..." explicitly click on
it before I open the Transaction to look at my Repo.

Yes I could get my repo out of the latter version of H2 via a SQL export
and then re import into V1.1.117, but it does not really help me, as you
said CDO only cares about the JDBC level of connection. If we cannot
Import into Derby on my collegues PC, not sure that trying to import
into H2 will make any difference. I'll ask him to give it a spin though.

Regards,

David


On 14/03/11 12:38, Eike Stepper wrote:
> Am 14.03.2011 13:05, schrieb David Wynter:
>> Eike,
>>
>> You say below "Why not the generated model?" I am not sure what you
>> mean by this, we have a genmodel generated with the CDO Native option.
>> I did not find an example or tutorial on how this might alter the need
>> to register the model we have every time we open the CDO Explorer
>> tool? Is there a way of using the genmodel file to prevent this?
> Please follow http://wiki.eclipse.org/CDO/Preparing_EMF_Models to
> regenerate your model for CDO and then everything should work
> automatically and more performant.
>
>>
>> And btw we went for the lowest common denominator, we use Derby, until
>> we have a reliable way of Importing and Exporting resources, then I'll
>> tackle my issue with H2 newer version support.
> Is there no SQL export/import in H2?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Thx.
>>
>> David
>>
>> On 14/03/11 10:50, Eike Stepper wrote:
>>> Am 14.03.2011 11:31, schrieb David Wynter:
>>>> Hi,
>>>>
>>>> I am referring to H2 1.1.117, V 1.3.153 is about to be released and
>>>> has hundreds of changes and bug fixes since 1.1.117, so of course it
>>>> is of interest. It took me a while to realise I can just simply do my
>>>> own H2 plugin, your arch diagram made this simple to understand, thx.
>>>>
>>>> The real frustration is that it has stalled a development using XText
>>>> where our model is in CDO. Sonme referenc eis here
>>>> http://www.eclipse.org/forums/index.php?t=msg&th=205902& amp;start=0&S=2941cbc188616abb91cd0a500e855e79
>>>>
>>>>
>>>>
>>>> I have everything working fine once we worked our the multi step
>>>> process for setting up a repo (including altering a table to have a
>>>> column as a CLOB).
>>> Maybe this artile helps:
>>> http://wiki.eclipse.org/Influence_DB_Store_mapping_by_using_ annotations
>>>
>>>> But since the other developer uses Windoze XP and not Linux and the
>>>> fact that despite hours of trying every combination, we cannot get my
>>>> repo onto his PC.
>>> Doesn't H2 have an SQL dump/import mechansim?
>>>
>>>>
>>>> I have asked him to document exactly the steps he takes and the
>>>> exception he gets when we use the "Build the repo from scratch and
>>>> import my Resource" method. We also tried copying across a already
>>>> loaded repo and connecting to that, but that has different exceptions.
>>>>
>>>> Here are the steps we follow:
>>>>
>>>> 0. Setup a cdo-server.xml for Derby
>>> Note that Derby is comparingly slow.
>>>
>>>> 1. Open the repo using CDO Explorer, then register the ecore model
>>>> from the workspace once I had attached to the repo
>>> Why not the generated model?
>>>
>>>> 2. Start a Transaction
>>>> 3. Add a Resource, commit and open in the editor.
>>>> 4. Exit CD Explorer, open the Derby Db in a SQL client and alter our
>>>> model table.column RESOURCE.CONTENT to CLOB(1000000), exit.
>>>> 5. Re open CDO Explorer and attach to the repo, makes sure you
>>>> register our model again,
>>> Shouldn't be needed if you used a generated model.
>>>
>>>> start a Transaction and open our resource and in the editor right
>>>> click and select Import Roots...
>>> Importing multiple resources is always tricky because of potential
>>> cross-references. Maybe there's a bug.
>>>
>>>> 6. Select your model file and click OK, wait until it finishes,
>>>> 7. Right click the Transaction in CDO Sessions and commit.
>>>>
>>>> At any point in CDO Explorer if you miss a step or make a mistake, you
>>>> MUST exit Eclipse and start again, including deleting the Derby
>>>> database directory, otherwise different exceptions are thrown.
>>>>
>>>> I don't have his exception to hand and he is not online, so will ask
>>>> him to follow up.
>>> Yeah, that exact info would be needed needed for a bugzilla ;-)
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> Thx.
>>>>
>>>> David
>>>> On 13/03/11 18:40, Eike Stepper wrote:
>>>>> Am 13.03.2011 14:10, schrieb David Wynter:
>>>>>> Hi,
>>>>>>
>>>>>> Since DbStore has ancient H2 version support
>>>>> Not sure how you mean that, but it's technically not correct, IMHO.
>>>>>
>>>>> CDO's DBStore has no knowledge about any particular DB vendor, it only
>>>>> knows about general JDBC. It does make use of specific Net4j
>>>>> DBAdapters
>>>>> through the interface IDBAdapter. Then there is the particular
>>>>> H2Adapter, which actually depends on the Java packages exported from a
>>>>> H2 JDBC driver distribution (bundle). These Java packages must be
>>>>> in the
>>>>> version range [1.0.0,2.0.0), which covers the most recent versions I'm
>>>>> seeing on http://www.h2database.com/html/main.html .
>>>>>
>>>>> The only thing that *may* be ancient is the H2 version 1.1.117
>>>>> distributed by the Orbit project:
>>>>> http://download.eclipse.org/tools/orbit/downloads/drops/S201 10304120314/
>>>>>
>>>>> . But that's not in our scope and you're free to deploy any bundle
>>>>> instead that exports the H2 packages in the version range
>>>>> [1.0.0,2.0.0).
>>>>>
>>>>> Here is a diagram of the actual architecture:
>>>>> http://dev.eclipse.org/mhonarc/lists/modeling-pmc/pngGWSdayo Itf.png
>>>>>
>>>>> You may not care (although Eclipse Legal keeps telling me that
>>>>> users do
>>>>> care), but even for these so called "optional / works-with"
>>>>> dependencies
>>>>> (those that we not even redistribute ourselves) we need to specifiy a
>>>>> single *exact* version number when we apply for a legal approval.
>>>>> So the
>>>>> effort to keep up with the external development is so high that we
>>>>> can't
>>>>> afford it for all the DB types that we support. I'm not sure where
>>>>> there
>>>>> is the right forum to complain about these picky processes, but as
>>>>> long
>>>>> as I'm the only person complaining about this certainly nothing will
>>>>> change.
>>>>>
>>>>>> thought I'd try Teneo Hibernate support for H2. I cannot use this
>>>>>> long
>>>>>> term as we must have CDO Revision support on one hand, but on the
>>>>>> other we have had so many exceptions trying to get CDO DbStore to
>>>>>> work
>>>>>> on Win XP it is difficult.
>>>>> What exceptions? Although I'm not the responsible for the DBStore I'm
>>>>> also not aware of any bugzillas that might be related. Most users
>>>>> report
>>>>> that they're very happy with the DBStore.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> Here is my cdo-server section for the H2
>>>>>>
>>>>>> <!-- Setting for h2
>>>>>> -->
>>>>>> <property name="hibernate.dialect"
>>>>>> value="org.hibernate.dialect.H2Dialect"/>
>>>>>> <property name="hibernate.connection.driver_class"
>>>>>> value="org.h2.Driver"/>
>>>>>> <property name="hibernate.connection.url"
>>>>>> value=" jdbc:h2:/home/david/workspace/com.example.project1/cdo_teneo /amodel;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE "/>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> And the relevant part of my annotation
>>>>>>
>>>>>> <eclass name="Resource">
>>>>>> <property name="content">
>>>>>> <lob />
>>>>>> <column length="1048576" />
>>>>>> </property>
>>>>>> </eclass>
>>>>>>
>>>>>>
>>>>>> [ERROR] INTEGER
>>>>>> java.lang.NoSuchFieldError: INTEGER
>>>>>> at
>>>>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOID MetaRangeUserType.nullSafeGet(CDOIDMetaRangeUserType.java:67 )
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:10 9)
>>>>>> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
>>>>>> at
>>>>>> org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
>>>>>> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java :1455)
>>>>>> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
>>>>>> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java: 611)
>>>>>> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
>>>>>> at
>>>>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
>>>>>> at
>>>>>> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:62)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:627)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:83)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1863)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.hibernate.type.CollectionType.getCollection(CollectionTy pe.java:647)
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.hibernate.type.CollectionType.resolveKey(CollectionType. java:431)
>>>>>> at org.hibernate.type.CollectionType.resolve(CollectionType.jav a:425)
>>>>>> at
>>>>>> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:139)
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:982)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.hibernate.loader.Loader.doQuery(Loader.java:857)
>>>>>> at
>>>>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:274)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.hibernate.loader.Loader.doList(Loader.java:2533)
>>>>>> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2276)
>>>>>> at org.hibernate.loader.Loader.list(Loader.java:2271)
>>>>>> at
>>>>>> org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLo ader.java:119)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
>>>>>> at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
>>>>>> at
>>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageUnits(HibernatePackageHandler.java:255)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ideas?
>>>>>>
>>>>>> Thx.
>>>>>>
>>>>>> David
>>>>
>>
Previous Topic:[CDO] H2 support
Next Topic:Avoiding xsi:type in instance serializations with no target namespace in schema
Goto Forum:
  


Current Time: Tue Apr 23 09:51:45 GMT 2024

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

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

Back to the top