Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] - Union Subclass out of memory
[Teneo] - Union Subclass out of memory [message #100171] Thu, 25 October 2007 10:18 Go to next message
Shane Coughlan is currently offline Shane CoughlanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi,

I am using teneo 0.8, EMF 2.3 and hibernate 3

I generated the hibernate mappings using
the right click Teneo option - Generate OR Mapping(joined-subclass),
creating our hibernate.hbm.xml file.

I modified the hibernate.hbm.xml file to use union-subclass
instead of joined-subclass.

On starting our application using the new hibernate mappings
we run into an out of memory exception(below).

any help is greatly appreciated.

Is there a teneo option to generate Hibernate mappings using
union-subclass?

Thanks,
Shane

Exception in thread "Thread-2" java.lang.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:45)
at java.lang.StringBuffer.<init>(StringBuffer.java:91)
at org.hibernate.sql.Select.toStatementString(Select.java:36)
at
org.hibernate.loader.AbstractEntityJoinWalker.initStatementS tring(AbstractEntityJoinWalker.java:115)
at
org.hibernate.loader.AbstractEntityJoinWalker.initStatementS tring(AbstractEntityJoinWalker.java:78)
at
org.hibernate.loader.AbstractEntityJoinWalker.initAll(Abstra ctEntityJoinWalker.java:58)
at
org.hibernate.loader.entity.EntityJoinWalker.<init>(EntityJoinWalker.java:42)
at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:65)
at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:43)
at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:33)
at
org.hibernate.loader.entity.BatchingEntityLoader.createBatch ingEntityLoader(BatchingEntityLoader.java:103)
at
org.hibernate.persister.entity.AbstractEntityPersister.creat eEntityLoader(AbstractEntityPersister.java:1744)
at
org.hibernate.persister.entity.AbstractEntityPersister.creat eEntityLoader(AbstractEntityPersister.java:1748)
at
org.hibernate.persister.entity.AbstractEntityPersister.creat eLoaders(AbstractEntityPersister.java:2980)
at
org.hibernate.persister.entity.AbstractEntityPersister.postI nstantiate(AbstractEntityPersister.java:2971)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:290)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1294)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
at com.pilz.pas.platform.db.DBHelper.<init>(DBHelper.java:212)
at
com.pilz.pas.platform.db.DBHelperFactory.initializeProjectsR epository(DBHelperFactory.java:150)
at
com.pilz.pas.platform.db.DBHelperFactory.initializeProjectsR epository(DBHelperFactory.java:127)
at
com.pilz.pas.platform.db.DBHelperFactory.initDefaultProjects Workspace(DBHelperFactory.java:39)
at
com.pilz.pas.platform.gui.internal.ApplicationWorkbenchWindo wAdvisor.postWindowCreate(ApplicationWorkbenchWindowAdvisor. java:255)
at
org.eclipse.ui.internal.WorkbenchWindow.fireWindowCreated(Wo rkbenchWindow.java:1192)
at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow .java:752)
at
org.eclipse.ui.internal.Workbench$21.runWithException(Workbe nch.java:1037)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
Re: [Teneo] - Union Subclass out of memory [message #100200 is a reply to message #100171] Thu, 25 October 2007 19:26 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Shane,
Does the out-of-memory also occur if you don't use union-subclass?
Is it possible for you to make a testcase which replicates the issue?

To get union subclass you can set the option:
PersistenceOptions.INHERITANCE_MAPPING to TABLE_PER_CLASS

Or set the inheritance annotation per eclass.

gr. Martin

Shane Coughlan wrote:
> Hi,
>
> I am using teneo 0.8, EMF 2.3 and hibernate 3
>
> I generated the hibernate mappings using
> the right click Teneo option - Generate OR Mapping(joined-subclass),
> creating our hibernate.hbm.xml file.
>
> I modified the hibernate.hbm.xml file to use union-subclass
> instead of joined-subclass.
> On starting our application using the new hibernate mappings
> we run into an out of memory exception(below).
>
> any help is greatly appreciated.
>
> Is there a teneo option to generate Hibernate mappings using
> union-subclass?
>
> Thanks,
> Shane
>
> Exception in thread "Thread-2" java.lang.OutOfMemoryError: Java heap space
> at
> java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:45)
> at java.lang.StringBuffer.<init>(StringBuffer.java:91)
> at org.hibernate.sql.Select.toStatementString(Select.java:36)
> at
> org.hibernate.loader.AbstractEntityJoinWalker.initStatementS tring(AbstractEntityJoinWalker.java:115)
>
> at
> org.hibernate.loader.AbstractEntityJoinWalker.initStatementS tring(AbstractEntityJoinWalker.java:78)
>
> at
> org.hibernate.loader.AbstractEntityJoinWalker.initAll(Abstra ctEntityJoinWalker.java:58)
>
> at
> org.hibernate.loader.entity.EntityJoinWalker.<init>(EntityJoinWalker.java:42)
>
> at
> org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:65)
> at
> org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:43)
> at
> org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:33)
> at
> org.hibernate.loader.entity.BatchingEntityLoader.createBatch ingEntityLoader(BatchingEntityLoader.java:103)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.creat eEntityLoader(AbstractEntityPersister.java:1744)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.creat eEntityLoader(AbstractEntityPersister.java:1748)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.creat eLoaders(AbstractEntityPersister.java:2980)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.postI nstantiate(AbstractEntityPersister.java:2971)
>
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:290)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1294)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
>
> at com.pilz.pas.platform.db.DBHelper.<init>(DBHelper.java:212)
> at
> com.pilz.pas.platform.db.DBHelperFactory.initializeProjectsR epository(DBHelperFactory.java:150)
>
> at
> com.pilz.pas.platform.db.DBHelperFactory.initializeProjectsR epository(DBHelperFactory.java:127)
>
> at
> com.pilz.pas.platform.db.DBHelperFactory.initDefaultProjects Workspace(DBHelperFactory.java:39)
>
> at
> com.pilz.pas.platform.gui.internal.ApplicationWorkbenchWindo wAdvisor.postWindowCreate(ApplicationWorkbenchWindowAdvisor. java:255)
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.fireWindowCreated(Wo rkbenchWindow.java:1192)
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow .java:752)
> at
> org.eclipse.ui.internal.Workbench$21.runWithException(Workbe nch.java:1037)
> at
> org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
>
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
>
>
>


--

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: [Teneo] - Union Subclass out of memory [message #100229 is a reply to message #100200] Fri, 26 October 2007 09:33 Go to previous messageGo to next message
Shane Coughlan is currently offline Shane CoughlanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

The hibernate.hbm.xml file generated
using the Generate OR Mapping(joined-subclass) option
works correctly. Out of memory exception does not oocur
and objects are persisted to database.
I edited this hibernate.hbm.xml replacing the joined-subclass mappings
with union-subclass mappings myself.

Setting the PersistenceOptions.INHERITANCE_MAPPING to TABLE_PER_CLASS:
How/Where do you set that?
Is that option used in generating a hibernate.hbm.xml file or used at
runtime
as a Teneo property?
In the org.eclipse.emf.teneo.PeristenceOptions.java there is no
TABLE_PER_CLASS
attribute so a little unsure of what to do.

Thanks,
Shane
Re: [Teneo] - Union Subclass out of memory [message #100243 is a reply to message #100229] Fri, 26 October 2007 11:53 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Shane,
When you use the right-click menu to generate a hbm then there is no possibility currently to pass
options.

You can also programmatically generate a hbm through the static HbHelper.generateMapping method
(make a class with a main method to call this method). This method allows you to pass a properties
object.
The relevant property here is:
PersistenceOptions.INHERITANCE_MAPPING (the actual property name is set in this java constant)
the value should be set to the string value: "TABLE_PER_CLASS"

gr. Martin

Shane Coughlan wrote:
> Hi Martin,
>
> The hibernate.hbm.xml file generated
> using the Generate OR Mapping(joined-subclass) option
> works correctly. Out of memory exception does not oocur
> and objects are persisted to database.
> I edited this hibernate.hbm.xml replacing the joined-subclass mappings
> with union-subclass mappings myself.
>
> Setting the PersistenceOptions.INHERITANCE_MAPPING to TABLE_PER_CLASS:
> How/Where do you set that?
> Is that option used in generating a hibernate.hbm.xml file or used at
> runtime
> as a Teneo property?
> In the org.eclipse.emf.teneo.PeristenceOptions.java there is no
> TABLE_PER_CLASS
> attribute so a little unsure of what to do.
>
> Thanks,
> Shane
>


--

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: [Teneo] - Union Subclass out of memory [message #100398 is a reply to message #100243] Wed, 31 October 2007 08:30 Go to previous messageGo to next message
Shane Coughlan is currently offline Shane CoughlanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

I was able to generate the union-subclass mapping hibernate.hbm.xml file
based on your suggestions.

I had to make one change to the generated file.
For our base class I had to remove the id generation mapping
as Hibernate complained that auto generation of ids is not permitted for
union-subclass

Changed the following from:

<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId" inherit="true">true</meta>
<generator class="native" />
</id>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler "
type="integer" unsaved-value="undefined" generated="never">
<meta attribute="syntheticVersion" inherit="true">true</meta>
</version>


to:

<id name="id" type="java.lang.String" column="`id`">
</id>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>

I am still encountering the out of memory exception.
I have tried increasing virtual memory arguments but to no effect.

Any other suggestions would be welcome??
Could the problem be with Hibernate?I will post to that forum as well.

Thanks,
Shane
Re: [Teneo] - Union Subclass out of memory [message #100410 is a reply to message #100398] Wed, 31 October 2007 09:12 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Shane,
Can you file the id-generation as a bugzilla (just with a link to this newsgroup post)?

Regarding the out-of-memory. I remember that someone earlier had problems with the memory use of the
datastore. The HbDataStore builds an in-memory structure of reference to. This structure is used to
compute a where-used for an object (so you can retrieve all the referencers to a specific object).
There was an earlier post on the memory use of this in-mem structure. I looked at it then but could
not find out why this structure was so large.

To not-build this in-memory structure you have to override the Datastore and let the computeReferers
method return an empty hashmap.

But I am not sure if this is really the problem as this same structure is build for a
joined-subclass (which did not give an out-of-memory error)...

Java memory is divided into several heaps (new objects, long-lived objects) etc. so you can try to
see which heap is out-of-memory (for example add -verbose:gc to the jvm startup parameters).
Otherwise I would use a profiler to see what the memory use is.

gr. Martin

Shane Coughlan wrote:
> Hi Martin,
>
> I was able to generate the union-subclass mapping hibernate.hbm.xml file
> based on your suggestions.
>
> I had to make one change to the generated file. For our base class I had
> to remove the id generation mapping
> as Hibernate complained that auto generation of ids is not permitted for
> union-subclass
>
> Changed the following from:
>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>
> <meta attribute="syntheticId" inherit="true">true</meta> <generator
> class="native" /> </id>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler "
> type="integer" unsaved-value="undefined" generated="never">
> <meta attribute="syntheticVersion" inherit="true">true</meta> </version>
>
>
> to:
>
> <id name="id" type="java.lang.String" column="`id`">
> </id>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>
> <meta attribute="syntheticVersion">true</meta>
> </version>
>
> I am still encountering the out of memory exception.
> I have tried increasing virtual memory arguments but to no effect.
>
> Any other suggestions would be welcome?? Could the problem be with
> Hibernate?I will post to that forum as well.
> Thanks,
> Shane
>


--

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: [Teneo] - Union Subclass out of memory [message #102746 is a reply to message #100410] Thu, 15 November 2007 08:52 Go to previous message
Shane Coughlan is currently offline Shane CoughlanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

bug raised.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209908

Thanks,
Shane
Re: [Teneo] - Union Subclass out of memory [message #610150 is a reply to message #100171] Thu, 25 October 2007 19:26 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Shane,
Does the out-of-memory also occur if you don't use union-subclass?
Is it possible for you to make a testcase which replicates the issue?

To get union subclass you can set the option:
PersistenceOptions.INHERITANCE_MAPPING to TABLE_PER_CLASS

Or set the inheritance annotation per eclass.

gr. Martin

Shane Coughlan wrote:
> Hi,
>
> I am using teneo 0.8, EMF 2.3 and hibernate 3
>
> I generated the hibernate mappings using
> the right click Teneo option - Generate OR Mapping(joined-subclass),
> creating our hibernate.hbm.xml file.
>
> I modified the hibernate.hbm.xml file to use union-subclass
> instead of joined-subclass.
> On starting our application using the new hibernate mappings
> we run into an out of memory exception(below).
>
> any help is greatly appreciated.
>
> Is there a teneo option to generate Hibernate mappings using
> union-subclass?
>
> Thanks,
> Shane
>
> Exception in thread "Thread-2" java.lang.OutOfMemoryError: Java heap space
> at
> java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:45)
> at java.lang.StringBuffer.<init>(StringBuffer.java:91)
> at org.hibernate.sql.Select.toStatementString(Select.java:36)
> at
> org.hibernate.loader.AbstractEntityJoinWalker.initStatementS tring(AbstractEntityJoinWalker.java:115)
>
> at
> org.hibernate.loader.AbstractEntityJoinWalker.initStatementS tring(AbstractEntityJoinWalker.java:78)
>
> at
> org.hibernate.loader.AbstractEntityJoinWalker.initAll(Abstra ctEntityJoinWalker.java:58)
>
> at
> org.hibernate.loader.entity.EntityJoinWalker.<init>(EntityJoinWalker.java:42)
>
> at
> org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:65)
> at
> org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:43)
> at
> org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:33)
> at
> org.hibernate.loader.entity.BatchingEntityLoader.createBatch ingEntityLoader(BatchingEntityLoader.java:103)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.creat eEntityLoader(AbstractEntityPersister.java:1744)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.creat eEntityLoader(AbstractEntityPersister.java:1748)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.creat eLoaders(AbstractEntityPersister.java:2980)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.postI nstantiate(AbstractEntityPersister.java:2971)
>
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:290)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1294)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
>
> at com.pilz.pas.platform.db.DBHelper.<init>(DBHelper.java:212)
> at
> com.pilz.pas.platform.db.DBHelperFactory.initializeProjectsR epository(DBHelperFactory.java:150)
>
> at
> com.pilz.pas.platform.db.DBHelperFactory.initializeProjectsR epository(DBHelperFactory.java:127)
>
> at
> com.pilz.pas.platform.db.DBHelperFactory.initDefaultProjects Workspace(DBHelperFactory.java:39)
>
> at
> com.pilz.pas.platform.gui.internal.ApplicationWorkbenchWindo wAdvisor.postWindowCreate(ApplicationWorkbenchWindowAdvisor. java:255)
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.fireWindowCreated(Wo rkbenchWindow.java:1192)
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow .java:752)
> at
> org.eclipse.ui.internal.Workbench$21.runWithException(Workbe nch.java:1037)
> at
> org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
>
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
>
>
>


--

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: [Teneo] - Union Subclass out of memory [message #610154 is a reply to message #100200] Fri, 26 October 2007 09:33 Go to previous message
Shane Coughlan is currently offline Shane CoughlanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

The hibernate.hbm.xml file generated
using the Generate OR Mapping(joined-subclass) option
works correctly. Out of memory exception does not oocur
and objects are persisted to database.
I edited this hibernate.hbm.xml replacing the joined-subclass mappings
with union-subclass mappings myself.

Setting the PersistenceOptions.INHERITANCE_MAPPING to TABLE_PER_CLASS:
How/Where do you set that?
Is that option used in generating a hibernate.hbm.xml file or used at
runtime
as a Teneo property?
In the org.eclipse.emf.teneo.PeristenceOptions.java there is no
TABLE_PER_CLASS
attribute so a little unsure of what to do.

Thanks,
Shane
Re: [Teneo] - Union Subclass out of memory [message #610155 is a reply to message #100229] Fri, 26 October 2007 11:53 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Shane,
When you use the right-click menu to generate a hbm then there is no possibility currently to pass
options.

You can also programmatically generate a hbm through the static HbHelper.generateMapping method
(make a class with a main method to call this method). This method allows you to pass a properties
object.
The relevant property here is:
PersistenceOptions.INHERITANCE_MAPPING (the actual property name is set in this java constant)
the value should be set to the string value: "TABLE_PER_CLASS"

gr. Martin

Shane Coughlan wrote:
> Hi Martin,
>
> The hibernate.hbm.xml file generated
> using the Generate OR Mapping(joined-subclass) option
> works correctly. Out of memory exception does not oocur
> and objects are persisted to database.
> I edited this hibernate.hbm.xml replacing the joined-subclass mappings
> with union-subclass mappings myself.
>
> Setting the PersistenceOptions.INHERITANCE_MAPPING to TABLE_PER_CLASS:
> How/Where do you set that?
> Is that option used in generating a hibernate.hbm.xml file or used at
> runtime
> as a Teneo property?
> In the org.eclipse.emf.teneo.PeristenceOptions.java there is no
> TABLE_PER_CLASS
> attribute so a little unsure of what to do.
>
> Thanks,
> Shane
>


--

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: [Teneo] - Union Subclass out of memory [message #610178 is a reply to message #100243] Wed, 31 October 2007 08:30 Go to previous message
Shane Coughlan is currently offline Shane CoughlanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

I was able to generate the union-subclass mapping hibernate.hbm.xml file
based on your suggestions.

I had to make one change to the generated file.
For our base class I had to remove the id generation mapping
as Hibernate complained that auto generation of ids is not permitted for
union-subclass

Changed the following from:

<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId" inherit="true">true</meta>
<generator class="native" />
</id>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler "
type="integer" unsaved-value="undefined" generated="never">
<meta attribute="syntheticVersion" inherit="true">true</meta>
</version>


to:

<id name="id" type="java.lang.String" column="`id`">
</id>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>

I am still encountering the out of memory exception.
I have tried increasing virtual memory arguments but to no effect.

Any other suggestions would be welcome??
Could the problem be with Hibernate?I will post to that forum as well.

Thanks,
Shane
Re: [Teneo] - Union Subclass out of memory [message #610180 is a reply to message #100398] Wed, 31 October 2007 09:12 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Shane,
Can you file the id-generation as a bugzilla (just with a link to this newsgroup post)?

Regarding the out-of-memory. I remember that someone earlier had problems with the memory use of the
datastore. The HbDataStore builds an in-memory structure of reference to. This structure is used to
compute a where-used for an object (so you can retrieve all the referencers to a specific object).
There was an earlier post on the memory use of this in-mem structure. I looked at it then but could
not find out why this structure was so large.

To not-build this in-memory structure you have to override the Datastore and let the computeReferers
method return an empty hashmap.

But I am not sure if this is really the problem as this same structure is build for a
joined-subclass (which did not give an out-of-memory error)...

Java memory is divided into several heaps (new objects, long-lived objects) etc. so you can try to
see which heap is out-of-memory (for example add -verbose:gc to the jvm startup parameters).
Otherwise I would use a profiler to see what the memory use is.

gr. Martin

Shane Coughlan wrote:
> Hi Martin,
>
> I was able to generate the union-subclass mapping hibernate.hbm.xml file
> based on your suggestions.
>
> I had to make one change to the generated file. For our base class I had
> to remove the id generation mapping
> as Hibernate complained that auto generation of ids is not permitted for
> union-subclass
>
> Changed the following from:
>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>
> <meta attribute="syntheticId" inherit="true">true</meta> <generator
> class="native" /> </id>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler "
> type="integer" unsaved-value="undefined" generated="never">
> <meta attribute="syntheticVersion" inherit="true">true</meta> </version>
>
>
> to:
>
> <id name="id" type="java.lang.String" column="`id`">
> </id>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>
> <meta attribute="syntheticVersion">true</meta>
> </version>
>
> I am still encountering the out of memory exception.
> I have tried increasing virtual memory arguments but to no effect.
>
> Any other suggestions would be welcome?? Could the problem be with
> Hibernate?I will post to that forum as well.
> Thanks,
> Shane
>


--

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: [Teneo] - Union Subclass out of memory [message #612532 is a reply to message #100410] Thu, 15 November 2007 08:52 Go to previous message
Shane Coughlan is currently offline Shane CoughlanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

bug raised.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209908

Thanks,
Shane
Previous Topic:Could we consider the opportunnity of a specific newsgroup for release anouncement ?
Next Topic:[Teneo] problem went copying with EcoreUtil.Copier
Goto Forum:
  


Current Time: Thu Apr 25 00:44:11 GMT 2024

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

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

Back to the top