dcsimg
Problems with automatic transaction generation.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, November 8, 2001 03:56 AM

If I try to use EJB in a JSP, transactions are created automatically, but I find no way to finish (commit) them and database connections keep open until I restart my EJB server (JBoss). Next code shows what I am trying to do: <%@page import="com.myCompany.core.stec.client.*"%> ... try { String sFailureNotificationId[] = request.getParameterValues("FailureIdList"); FailureNotificationHome home=null; FailureNotificationModel fnm; FailureNotificat   More>>


If I try to use EJB in a JSP, transactions are created automatically,
but I find no way to finish (commit) them and database connections keep
open until I restart my EJB server (JBoss). Next code shows what I am trying
to do:











<%@page import="com.myCompany.core.stec.client.*"%>




...



try {

String sFailureNotificationId[] = request.getParameterValues("FailureIdList");


FailureNotificationHome home=null;

FailureNotificationModel fnm;

FailureNotification fn; //Remote reference
to the CMP EntityBean

home = FailureNotificationHomeManager.getFailureNotificationHome();


...

for (int counter=0; counter

try {

//¡ ¡ ¡ Next lines start a transaction
! ! ! (I am not sure whether in the first or second one)

fn = home.findByPrimaryKey(new FailureNotificationPK(Id[counter]);


FailureNotificationModelExtended failureData = fn.getDetailsExtended();


...

} catch (Exception e) {}

// What I have to do to make transactions commit/roolback/not
be created? .

}

}

...






Could it be a problem related with JAWS/JBoss configuration?.



Thanks in advance for any suggestions!




   <<Less

Re: Problems with automatic transaction generation.

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, November 8, 2001 06:13 AM

you should not have to do anything unless you use UserTransaction. since you are calling on EJB, EJB container (in container managed transactional context) should start and commit the transaction if everything is setup correctly in ejb-jar.xml. so if that is the case, the problem is probably related to something in JAWS/JBOSS.
About | Sitemap | Contact