Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369384 - [hibernate] large commits lead to timeout excetions
Summary: [hibernate] large commits lead to timeout excetions
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-23 09:04 EST by Stefan Winkler CLA
Modified: 2019-11-08 03:13 EST (History)
0 users

See Also:


Attachments
simplistic-patch (2.14 KB, patch)
2012-01-23 09:09 EST, Stefan Winkler CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Winkler CLA 2012-01-23 09:04:49 EST
I came over an issue today. I am trying to set up some performance measurements to compare the different CDO stores. To set up a model with 10.000 Objects, this is what I do:

private Company initModel() throws CommitException
  {
    msg("Initializing model ...");
    CDOSession session = openSession();
    CDOTransaction transaction = session.openTransaction();
    CDOResource resource = transaction.createResource(getResourcePath("res"));

    Company company = getModel1Factory().createCompany();
    resource.getContents().add(company);

    for (int i = 0; i < AMOUNT_ELEMENTS; i++)
    {
      Category cat = getModel1Factory().createCategory();
      cat.setName(Integer.toString(i));
      company.getCategories().add(cat);
    }

    System.out.println("Final Commit...");
    transaction.commit();
    System.out.println("Done.");

    return company;
  }

What happens is that I get a timeout during the commit, because the commit runs longer than 10 seconds.
Comment 1 Stefan Winkler CLA 2012-01-23 09:09:38 EST
Created attachment 209913 [details]
simplistic-patch

Hi Martin,

as discussed via E-Mail I am attaching this patch (should be applicable to the workspace root via Team...>Apply Patch) to prevent the timeout.

Please note that it might be even better to have a more fine-grained monitoring of the single steps and use single forkAsync() calls only in those places in which you call actual hibernate API. The benefit of this is a more fine-grained progress reporting in the client (you can show an actual ProgressMonitor in client UIs for commit operations).
Comment 2 Martin Taal CLA 2012-01-26 14:35:06 EST
Pushed a solution to the git repository, will be in the next build.
Comment 3 Eike Stepper CLA 2012-09-21 07:18:17 EDT
Closing.