Database Connectivity and the API  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Database Connectivity and the API

Postby SBarnes » Thu Jul 01, 2021 7:49 pm

We have a client who is running the api against Azure SQL and the api sometimes drops its connection to the database, a service restart fixes the issue and I have already increased the timeout, Jiwa itself goes on quite happily from the same Azure vm which I suspect is due to its baked in redundancy to reconnect itself, in having a quick look at ORMLite under the hood it appears it's using the same technology, so my question is there a simple way to add the same sort of redundancy to the api like Jiwa has?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Database Connectivity and the API

Postby Mike.Sheen » Fri Jul 02, 2021 11:45 am

SBarnes wrote:We have a client who is running the api against Azure SQL and the api sometimes drops its connection to the database, a service restart fixes the issue and I have already increased the timeout, Jiwa itself goes on quite happily from the same Azure vm which I suspect is due to its baked in redundancy to reconnect itself, in having a quick look at ORMLite under the hood it appears it's using the same technology, so my question is there a simple way to add the same sort of redundancy to the api like Jiwa has?


The connection resilience and transaction fault tolerance the Jiwa application enjoys would still apply to the REST API. For the operations which are backed by Jiwa business logic, these all use the same database layer as the Jiwa application - so the behaviour and capabilities are exactly the same.

I've logged DEV-8770 to test and see if we can find an issue and if so, provide a fix or work-around.
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Database Connectivity and the API

Postby SBarnes » Fri Jul 02, 2021 11:50 am

The line it fails on is definitely directly ORMLite related as its when it gets records from SY_WebhookMessages
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Database Connectivity and the API  Topic is solved

Postby Mike.Sheen » Wed Mar 02, 2022 3:11 pm

If the symptom was this error:
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.


Then I believe this was fixed with DEV-9205.

Our Webhooks and a few other parts of the REST API plugin were using OrmLite and not correctly disposing of the connection - resulting in the pool being exhausted in some circumstances.
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to REST API

Who is online

Users browsing this forum: No registered users and 2 guests

cron