ORM Postgresql DeadLock?

28 Views Asked by At

I modified the method UserService::getUserById in the example-postgresql program to include 3 more queries (created the tables appuserdetail, appuserdetail1 and appuserdetai2 - all with an id(text) and two integers).

inside the method I included :

auto dbResultDetail = m_database->getUserDetailById(id); auto resultDetail = dbResultDetail->fetchoatpp::Vector<oatpp::Object<UserDetailDto>>(); auto dbResultDetail1 = m_database->getUserDetailById1(id); auto resultDetail1 = dbResultDetail1->fetchoatpp::Vector<oatpp::Object<UserDetailDto>>(); auto dbResultDetail2 = m_database->getUserDetailById2(id); auto resultDetail2 = dbResultDetail1-2fetchoatpp::Vector<oatpp::Object<UserDetailDto>>();

if I test the program using apache benchmark (ab -n 300 -c 4 localhost:8000/users/myuserid...) it frezes (deadlock?), if i limit the queries from 4 to 3 it works, if i put a lock_guard in the beginning of the method it also works.

How can I troubleshoot this ?

I'm using oatpp 1.3.0.

I was expecting the api to work with 4 queries, it works if i use only 3 or put a lock_guard in the function.

0

There are 0 best solutions below