Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » efficient strategy to avoid too many transaction.commit()
efficient strategy to avoid too many transaction.commit() [message #836647] Wed, 04 April 2012 18:41 Go to next message
Ligaj Pradhan is currently offline Ligaj PradhanFriend
Messages: 2
Registered: April 2012
Junior Member
Hi everyone !

I have a many to many relationship between 'Books' and 'Writers' in my EMF model.

I have multiple repositories from where I extract the data and populate my models and store them in SQL database.

I have to check from the database if the writer already exists. (The writers are unique with their unique id).

checking from the resource if it contains the writer with certain id would be much faster but since I want to incrementally add the data every couple of days.....resources would not be available...

checking from the database if the writer exists....would also mean that I have to do transaction.commit() everytime I add a writer....

transaction.commit() after extracing every new writer is proving to be very time consuming.....especially while extracting thousands and thousands of writers.

Is there any efficient strategy to avoid this transaction.commit() every time ?

Thanks a lot!
Ligaj



Re: efficient strategy to avoid too many transaction.commit() [message #836652 is a reply to message #836647] Wed, 04 April 2012 18:50 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ligaj,
For the sql database storage, are you using one of the existing technologies: CDO or Teneo or something else?

gr. Martin

On 04/04/2012 08:41 PM, Ligaj Pradhan wrote:
> Hi everyone !
> I have a many to many relationship between 'Books' and 'Writers' in my EMF model.
> I have multiple repositories from where I extract the data and populate my models and store them in SQL database.
> I have to check from the database if the writer already exists. (The writers are unique with their unique id).
> checking from the resource if it contains the writer with certain id would be much faster but since I want to
> incrementally add the data every couple of days.....resources would not be available...
>
> checking from the database if the writer exists....would also mean that I have to do transaction.commit() everytime I
> add a writer....
>
> transaction.commit() after extracing every new writer is proving to be very time consuming.....especially while
> extracting thousands and thousands of writers.
>
> Is there any efficient strategy to avoid this transaction.commit() every time ?
>
> Thanks a lot!
> Ligaj
>
>
>
>


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: efficient strategy to avoid too many transaction.commit() [message #836785 is a reply to message #836652] Wed, 04 April 2012 23:04 Go to previous messageGo to next message
Ligaj Pradhan is currently offline Ligaj PradhanFriend
Messages: 2
Registered: April 2012
Junior Member
Hello Martin,

Yes, I am using CDO Hibernate

Regards,

Re: efficient strategy to avoid too many transaction.commit() [message #836800 is a reply to message #836647] Wed, 04 April 2012 23:41 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 04.04.2012 20:41, schrieb Ligaj Pradhan:
> Hi everyone !
> I have a many to many relationship between 'Books' and 'Writers' in my EMF model.
> I have multiple repositories from where I extract the data and populate my models and store them in SQL database.
> I have to check from the database if the writer already exists. (The writers are unique with their unique id).
> checking from the resource if it contains the writer with certain id would be much faster but since I want to
> incrementally add the data every couple of days.....resources would not be available...
>
> checking from the database if the writer exists....would also mean that I have to do transaction.commit() everytime I
> add a writer....
>
> transaction.commit() after extracing every new writer is proving to be very time consuming.....especially while
> extracting thousands and thousands of writers.
Even if we find a solution to the million lookups problem you should call CDOTransaction.commit every couple thousand
instertions to free up resources on the client side.

>
> Is there any efficient strategy to avoid this transaction.commit() every time ?
If you import many books of a few number of writers a local HashSet with the writers' IDs can prevent multiple redundant
remote lookups. If the imports all happen from one client I would probably try to cache the set in a file a nd reuse it
for later imports.

Cheers
/Eike

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


Previous Topic:Creating then Saving really large EMF models
Next Topic:XSD generation from ecore
Goto Forum:
  


Current Time: Fri Apr 26 20:36:55 GMT 2024

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

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

Back to the top