I 'm using PostgreSQL 9.3 installation and plpgsql functions.
I have written a function and it contain few cursors, insertions & updatations.I'm calling this function on adempier(ERP System) form by passing few parameters.

Suppose, it takes 5 min to complete the whole process for one user & another 10 min to complete same process with different parameters separately.But when both users are running same process simultaneously, it takes 15 min for both users to complete the process.
Even 'commit' key word is not inserted at the end of the function, it is in the form level.

I need to finish the every process,once it completed.
Anybody pls help to solve this issue.
Many Thanks