Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Auto-Commit in CDO(To discuss about how auto-commit functionality can be achieved in CDO)
[CDO] Auto-Commit in CDO [message #1799819] Fri, 14 December 2018 08:24 Go to next message
Nirmal Kanagasabai is currently offline Nirmal KanagasabaiFriend
Messages: 11
Registered: July 2017
Junior Member
Hello Team,

We would like to know about how auto-commit functionality can be achieved in CDO. A quick search on it revealed that it has already been implemented.

In this URL, you are talking about turning on the automatic commit functionality for a particular transaction and from this, it can be observed that auto-commit has been implemented as early as 2009.

This question may be too trivial. It's just that I have spent quite sometime trying to achieve this through every other means possible. Perhaps, there's a much more easier solution to achieve the same.

Regards,
Nirmal
Re: [CDO] Auto-Commit in CDO [message #1799825 is a reply to message #1799819] Fri, 14 December 2018 09:46 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Hi Nirmal,

You can achieve the desired behavior with the following piece of code:

public class CDOAutoCommitter extends CDOPostEventTransactionHandler.Default
{
  public CDOAutoCommitter(CDOTransaction transaction)
  {
    transaction.addTransactionHandler(this);
  }

  @Override
  protected void modifiedObject(CDOTransaction transaction, CDOObject object, Notification msg)
  {
    try
    {
      transaction.commit();
    }
    catch (ConcurrentAccessException ex)
    {
      ex.printStackTrace();
    }
    catch (CommitException ex)
    {
      ex.printStackTrace();
    }
  }
}


If you submit a bugzilla I can provide the respective code in CDO.

Cheers
/Eike


Re: [CDO] Auto-Commit in CDO [message #1799827 is a reply to message #1799825] Fri, 14 December 2018 09:54 Go to previous messageGo to next message
Nirmal Kanagasabai is currently offline Nirmal KanagasabaiFriend
Messages: 11
Registered: July 2017
Junior Member
Hello Eike,

Thank you very much for the super quick reply. I will look at the code you provided above and will get back to you if I need further clarifications.

If I think this is really pressing, I will be submitting a Bugzilla soon :)

Regards,
Nirmal
Re: [CDO] Auto-Commit in CDO [message #1800553 is a reply to message #1799827] Wed, 02 January 2019 09:55 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Please see bug 543116: Provide a CDOAutoCommitter ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=543116 )

Previous Topic:Ignoring whitespace before XML header
Next Topic:Problem with load
Goto Forum:
  


Current Time: Thu Sep 19 08:19:53 GMT 2019

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

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

Back to the top