Question for EJB Expert

Posted on 2003-04-01
Medium Priority
Last Modified: 2013-11-24
I have an EJB application which is connected to a web site. The website is
developed using JSPs & Servlets.

Most of the JSPs have two buttons.

One to submit the information and the second to reset the information.

When the user clicks on the submit button, the information goes to EJB
through a servlet. It takes almost 8 seconds for the EJBs to save the

During these 8 seconds, if the user clicks on the reset button, I want
to stop the EJB from doing all the processing, transaction, etc... and
rollback everything.

Is there any way to do this ? Any pointers, URLs, references to any other
resource would be greatly appreciated.
Question by:arooj_aftab
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 35

Expert Comment

ID: 8248397
The only way I can think of for doing this would be:

1) Make sure you have Stateful session bean EJBs
2) Start doing the event when user clicks go button..  AT each step, check the flag inside the EJB -- boolean cancelled;
3) If cancelled is true, then rollback (easiest way is to throw a RemoteException if you are using CMT)

Then, the cancel button can call the setCancelled() method inside the session EJB, setting it to true, and forcing the other process to stop...

Of course, both calls will have to go to the same session bean...  Maybe cache remote handles inside the session for the current user in the webapp?

Hope this helps...  Just some thoughts...

It's a tricky thing that most people skirt around...

LVL 35

Accepted Solution

TimYates earned 1000 total points
ID: 8259851

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question