Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Where are the transaction boundaries?
Where are the transaction boundaries? [message #1075650] Mon, 29 July 2013 16:27 Go to next message
Chris Snow is currently offline Chris Snow
Messages: 50
Registered: December 2011
Member
How does scout demarcate transactions? Say I have two SQL statements as below, where does scout start and end the transactions?

 @Override
  public CompanyFormData create(CompanyFormData formData) throws ProcessingException {
    if (!ACCESS.check(new CreateCompanyPermission())) {
      throw new VetoException(TEXTS.get("AuthorizationFailed"));
    }

    SQL.selectInto("" +
        "SELECT MAX(COMPANY_NR)+1 " +
        "FROM   COMPANY " +
        "INTO   :companyNr"
        , formData);
    SQL.insert("" +
        "INSERT INTO COMPANY (COMPANY_NR, SHORT_NAME, NAME) " +
        "VALUES (:companyNr, :shortName, :name)"
        , formData);

    return formData;
  }


Many thanks,

Chris
Re: Where are the transaction boundaries? [message #1075657 is a reply to message #1075650] Mon, 29 July 2013 16:39 Go to previous messageGo to next message
Arthur vD is currently offline Arthur vD
Messages: 50
Registered: March 2010
Member
Hi

A very short explanation can be found here: http://wiki.eclipse.org/Scout/Concepts/Server_Plug-In#Transaction_Handling
The corresponding sequence diagram: http://wiki.eclipse.org/images/8/84/ScoutRemoteServiceCall.png
And there is this older forum post: http://www.eclipse.org/forums/index.php/t/245472/

Normally all your SQL statements which are called within one scout client to scout server call are handled within one transaction (and rolled back if something goes wrong during that client to server call). If you don't have special needs you usually don't care much about the transaction handling which is done in the background.
Re: Where are the transaction boundaries? [message #1075661 is a reply to message #1075657] Mon, 29 July 2013 16:43 Go to previous messageGo to next message
Chris Snow is currently offline Chris Snow
Messages: 50
Registered: December 2011
Member
That's a great explanation - thank you.
Re: Where are the transaction boundaries? [message #1075929 is a reply to message #1075661] Tue, 30 July 2013 06:46 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 657
Registered: October 2011
Senior Member
More links:
* (wiki) Concepts > Client-Server Communication
* (forum) Multiple SQL operations and commit
Previous Topic:Using IOUtility from behind an authenticating proxy
Next Topic:Scout windows traslater?
Goto Forum:
  


Current Time: Fri Aug 22 00:05:49 EDT 2014

Powered by FUDForum. Page generated in 0.08266 seconds