• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in saving using EJB set method involving look up tables

Balu Chidambar
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am developing a Web Based Automation system using EJB. I am developing the system using JDeveloper 903. I have ended up with some problems in inserting data to theContainer Managed Field( CMR) fields in the database. The problem is that when we submit the page and try for saving data the system hangs and gives a transaction timeout. Everything was working fine in the test setup database containing around 100-500 records. But the system is now exposed to a huge database of around 5 lak records. I have mentioned below the basic architecture and some code snippets.
To be more clear I wil take two tables OPICMR and RELIGION

transaction table

REG_NO ============>Primary Key
RELIGION ============> Foriegn Key Relation to CODE in RELIGION TABLE.

This table consists of around 3 Lak records

Lookup table

CODE ============> Primary Key
This table consists of around 20 records.

I have created a session EJB named OPSessionEJB and in that I have added the following code for getting the referrence of Religion entity bean for my JSP page.
public ReligionLocal getRefReligion(String key){
return this.getReligionLocalHome().findByPrimaryKey(key);
catch(Exception e){
return null;

I have written Jsp page for getting the inputs from user and when the user submits, a SAVE.jsp page is invoked.

In my SAVE.jsp page
Step -1
Insert a record in OPICMR table for a selected regno as shown by the code below:-

String RegNo=request.getParameter("RegNo");

OpicmrLocal OpicmrLocalObj=OPSessionEJBLocal.setOpicmrDetails(RegNo));

Step -2

To set the value of the field "religion" in table OPICMR, i have used the code given below:-

String Religion=request.getParameter("Religion");

OpicmrLocalObj.setReligion_religion(OPSessionEJBLocal.getRefReligion(Religion));<==== Timeout

I am getting a transaction timeout when i am trying to execute the above statement. i.e when trying to set through Container Managed Relation(CMR) the value of a database field which has foriegnkey reference to another table field.

Please note that the above code is working fine when the table OPICMR has less number of records.

I have around 15 look up tables and I have followed the same method for all these. Please suggest a a solution to the timeout problem.

Thanks in Advance
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic