Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to setup concurrent calls in Oracle 10g Java VM
    primarykey
    data
    text
    <p>If somebody can explain me how to properly configure plsql java wrapper when different database users invoke same procedure to ensure correct concurrent resource access handling.</p> <p>DBMS and JAVA: Oracle 10g, internal JavaVM 1.4.2</p> <p>I have MyDatabse with 1 shema owner and 10 db users granted to connect to it:<br /> DBOWNER<br /> DBUSER01<br /> DBUSER02<br /> ...<br /> DBUSER10</p> <p>I have PL/SQL wrapper procedure: my_package.getUser() that wrapps UserHandler.getUser()</p> <p>I have java class UserHandler uploaded to MyDatabase with loadjava:</p> <pre><code>public class UserHandler { private static final int MAX_USER_COUNT = 10; private static final String USERNAME_TEMPLATE = "EIS_ORA_20"; private static int currentUserSeed = 0; /** * Generates EIS user according to pattern agreed by EIS developers. It * circles user pool with round-robin method ensuring concurrent calls. * * @return valid EIS USERNAME */ synchronized public static String getUser() { String newUser = USERNAME_TEMPLATE + currentUserSeed; currentUserSeed++; currentUserSeed = currentUserSeed % MAX_USER_COUNT; return newUser; } } </code></pre> <p>The idea of wrapper is to ensure proper distribution of external information system usernames to DBUSERS connected to MyDatabase with Oracle Forms Client Application.</p> <p>My problem is that when 5 users concurently call procedure my_package.getUser() I got:<br /></p> <blockquote> <p>DBUSER01 - call to my_package.getUser() returned EIS_ORA_200<br /> DBUSER02 - call to my_package.getUser() returned EIS_ORA_200<br /> DBUSER03 - call to my_package.getUser() returned EIS_ORA_200<br /> DBUSER04 - call to my_package.getUser() returned EIS_ORA_200<br /> DBUSER05 - call to my_package.getUser() returned EIS_ORA_200<br /></p> </blockquote> <p>I was expected that each DBUSER would get different user (as I confirmed in my JUnit tests where multiple concurrent threads invoke UserHandler.getUser()). Later I've red that plsql wrapper calls can be setup in 2 maner:</p> <ol> <li>to share java memory space between DBUSERS or</li> <li>to separate memory space for each DBUSER</li> </ol> <p>My conclusion is that UserHandler class is loaded for each DBUSER separately and that is why I have no use of static counter and synchronized method.</p> <p>How to configure MyDatabase to force calls to my_package.getUser() use same java space for each DBUSER?</p> <p>Thank you very much!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload