Web API and Database Transactions  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Web API and Database Transactions

Postby SBarnes » Sun Mar 11, 2018 4:12 pm

Hi Mike,

Is there anywhere in Web API plugin that uses database transactions, preferably with an ORM Lite database transaction?

I have a situation with a current client where they have two tables in the database header and lines, non Jiwa tables in a Jiwa database, think of a sales order for a similar analogy, and there are already stored procedures that exist to write data to both tables which I can generate the necessary code for through the T4 templates and can extend the API in my own version of a Web API Plugin to get data into the tables but would obviously prefer to have an all or nothing scenario in terms of writing to both tables in terms of the data submitted.

Thanks for any help you can provide on this.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Web API and Database Transactions  Topic is solved

Postby Mike.Sheen » Mon Mar 12, 2018 9:05 am

SBarnes wrote:Hi Mike,

Is there anywhere in Web API plugin that uses database transactions, preferably with an ORM Lite database transaction?

I have a situation with a current client where they have two tables in the database header and lines, non Jiwa tables in a Jiwa database, think of a sales order for a similar analogy, and there are already stored procedures that exist to write data to both tables which I can generate the necessary code for through the T4 templates and can extend the API in my own version of a Web API Plugin to get data into the tables but would obviously prefer to have an all or nothing scenario in terms of writing to both tables in terms of the data submitted.

Thanks for any help you can provide on this.


Hi Stuart,

No - we have no examples, but ServiceStack has some examples in their documentation of how to use transactions with ORM Lite.

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Web API and Database Transactions

Postby SBarnes » Mon Mar 12, 2018 9:08 am

Thanks.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to REST API

Who is online

Users browsing this forum: No registered users and 5 guests