Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Teneo persistency - performance questions
Teneo persistency - performance questions [message #420109] Wed, 18 June 2008 10:23 Go to next message
Balazs Molnar is currently offline Balazs MolnarFriend
Messages: 28
Registered: July 2009
Junior Member
Hello,

I have taken the Library example and loaded some data (around 100 writers
and about 10000 books.
I tested both JPOX and HIBERNATE persistency options with default
configurations with Derby.
My aim was to find out some of the loading and query attributes of the
solution and compare them on my desktop - focusing on comparison not
really on absolute performance.

I found the followings:
(JPOX)
- it took JPOX to load the above amount of data around 24 minutes!
- modifying the Library aggregation of Books
(theLib.getBooks().add(aBook); ) were efficient as compared to Hibernate -
under one second !

(HIBERNATE)
- it took Hibernate to load the data 3 minutes!
- modifying the Library aggregation of Books - same as in JPOX code above
- took 42 seconds!

My questions:
- is there a known way to make loading "larger" data volume using JPOX
faster ?
- can I make the manipulation of larger aggregates (e.g. Library.books)
faster with Hibernate ? Or Should I avoid using aggregates with larger
collections ?
- is there a preferred Teneo persistency solution ? I have noticed the
supported JPOX version is not the latest one while Hibernate seems to work
with latest Hibernate versions ? Is there a reason for this ?
- When experimenting with Hibernate I attempted to set the persistency
option and it failed, can someone help me on what I am doing wrong ?:
>
hibernateProperties.setProperty(PersistenceOptions.MAP_ALL_L ISTS_AS_IDBAG,
"true");
and it caused an exception at
>HbSessionDataStore.initialize
with the exception:

Exception in thread "main" org.hibernate.MappingException: invalid mapping
at org.hibernate.cfg.Configuration.addXML(Configuration.java:44 4)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:156)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:73)
at hu.f400.emf.teneo.test.hbtutorial.Tutorial1.main(Tutorial1.j ava:116)
Caused by: org.xml.sax.SAXParseException: The content of element type
"class" must match
" (meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id |composite-id),discriminator?,natural-id?,(version|timestamp )?,(property|many-to-one|one-to-one|component|dynamic-compon ent|properties|any|map|set|list|bag|idbag|array|primitive-ar ray)*,((join*,subclass*)|joined-subclass*|union-subclass*),l oader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset *,(query|sql-query)*) ".
Re: Teneo persistency - performance questions [message #420159 is a reply to message #420109] Thu, 19 June 2008 14:26 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Balázs,
The idbag related exception is a bug. I have solved it and checked it in cvs. I will come back later
today/tomorrow to you on the performance comparipart of your post.

With the term 'load' in your post, you mean store in the db, correct?

The JPOX version is lagging behind because going from 1.1.9 to 1.2.0 (and the datanucleus platform)
the internal api of jpox has been changed completely. It is a fair amount of work for me to make
this transition. In combination with the lesser popularity of jpox this has resulted in that jpox
support has not been upgraded (although I promised a few times :-(. The only thing I can say that
the jpox support will be upgraded but when I don't know (if someone asks for it every week it will
probably go faster).

So for now hibernate support is more complete. The idbag should help in the performance of updates
on large collections. In addition hibernate has the concept of extra-lazy collections, these are
however not yet support with Teneo (but has been requested:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=221288).

gr. Martin

Balázs Molnár wrote:
> Hello,
>
> I have taken the Library example and loaded some data (around 100
> writers and about 10000 books.
> I tested both JPOX and HIBERNATE persistency options with default
> configurations with Derby.
> My aim was to find out some of the loading and query attributes of the
> solution and compare them on my desktop - focusing on comparison not
> really on absolute performance.
>
> I found the followings:
> (JPOX)
> - it took JPOX to load the above amount of data around 24 minutes!
> - modifying the Library aggregation of Books
> (theLib.getBooks().add(aBook); ) were efficient as compared to Hibernate
> - under one second !
>
> (HIBERNATE)
> - it took Hibernate to load the data 3 minutes!
> - modifying the Library aggregation of Books - same as in JPOX code
> above - took 42 seconds!
> My questions:
> - is there a known way to make loading "larger" data volume using JPOX
> faster ?
> - can I make the manipulation of larger aggregates (e.g. Library.books)
> faster with Hibernate ? Or Should I avoid using aggregates with larger
> collections ?
> - is there a preferred Teneo persistency solution ? I have noticed the
> supported JPOX version is not the latest one while Hibernate seems to
> work with latest Hibernate versions ? Is there a reason for this ?
> - When experimenting with Hibernate I attempted to set the persistency
> option and it failed, can someone help me on what I am doing wrong ?:
> >
> hibernateProperties.setProperty(PersistenceOptions.MAP_ALL_L ISTS_AS_IDBAG,
> "true");
> and it caused an exception at >HbSessionDataStore.initialize
> with the exception:
>
> Exception in thread "main" org.hibernate.MappingException: invalid mapping
> at org.hibernate.cfg.Configuration.addXML(Configuration.java:44 4)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:156)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:73)
>
> at hu.f400.emf.teneo.test.hbtutorial.Tutorial1.main(Tutorial1.j ava:116)
> Caused by: org.xml.sax.SAXParseException: The content of element type
> "class" must match
> " (meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id |composite-id),discriminator?,natural-id?,(version|timestamp )?,(property|many-to-one|one-to-one|component|dynamic-compon ent|properties|any|map|set|list|bag|idbag|array|primitive-ar ray)*,((join*,subclass*)|joined-subclass*|union-subclass*),l oader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset *,(query|sql-query)*) ".
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo persistency - performance questions [message #420172 is a reply to message #420159] Fri, 20 June 2008 09:35 Go to previous messageGo to next message
Balazs Molnar is currently offline Balazs MolnarFriend
Messages: 28
Registered: July 2009
Junior Member
Hello Martin,

Yes, by loading I meant a simple store of data - created new instances of
writers and books and added them to the library. I made one attempt to
optimize Hibernate insertions by adding a "flush()" after the creation of
each writer (each writer (100) had 1000 books). My code is so ugly that I
did not want to paste it here:(


regards,
Balázs
Re: Teneo persistency - performance questions [message #420174 is a reply to message #420172] Fri, 20 June 2008 11:36 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050205000001010709000403
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Bal
Re: Teneo persistency - performance questions [message #420184 is a reply to message #420174] Fri, 20 June 2008 13:19 Go to previous messageGo to next message
Balazs Molnar is currently offline Balazs MolnarFriend
Messages: 28
Registered: July 2009
Junior Member
Hello Martin!

Thank you for the thorough answer. I will give an attempt to use the idbag
- once I figure out how to check out from the cvs.

Assuming I have a solution to the persistency problem - with satisfactory
performance - I have so far planned to generate the model and edit code
and planned on designing specific views and editors on top -
I have assumed the use of EMF Resources would not give me the right way
into the database (with custom queries, etc.) .

Is this route advised/disadvised ?

thanks,
Balázs
Re: Teneo persistency - performance questions [message #420188 is a reply to message #420184] Fri, 20 June 2008 13:58 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Balázs,
I will check in everything late today, so you have to wait a few hours more I am afraid.

You can also fill a resource using a query, so it is possible to work with resources (although I for
sure agree that the resource concept is different than a relational db):
http://www.elver.org/hibernate/hibernateresources.html#Set+s pecific+queries+to+load+the+resource

gr. Martin

Balázs Molnár wrote:
> Hello Martin!
>
> Thank you for the thorough answer. I will give an attempt to use the
> idbag - once I figure out how to check out from the cvs.
>
> Assuming I have a solution to the persistency problem - with
> satisfactory performance - I have so far planned to generate the model
> and edit code and planned on designing specific views and editors on top
> - I have assumed the use of EMF Resources would not give me the right
> way into the database (with custom queries, etc.) .
> Is this route advised/disadvised ?
>
> thanks,
> Balázs
>
>


--

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:EMap notify problem
Next Topic:different primitive types
Goto Forum:
  


Current Time: Fri Mar 29 13:11:59 GMT 2024

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

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

Back to the top