Properly using Remove() in servlet

I have a servlet that utilizes a stateful session bean. The bean holds a resultset that can be accessed multiple times throughout a servlet's session.
However, when the servlet's session times out, I want to make certain the EJB is not still residing in memory when it shouldn't be.
Questions:
- How do I call remove on the EJB object when the servlet's session expires?
- What happens when remove is not explicitly called in relation to a stateful session bean?
Thanks everyone, great forum.
Mark S.

I have tried this, and I agree it must be the way to handle my cleaning, but I am having some problems I hope you can help with.
I make my servlet implement HttpSessionListener (and it extends another class). Then I put the proper tags at the beginning of my web.xml file to map to the listener class. However, when I put the tags in the web.xml file for the listener, none of my servlets will work!
I also have a the associated HttpSessionListener functions defined in the implemented class, which do nothing but print output if they would ever be called.
-Any ideas on my problem here?
Thanks again,
Mark S.

Similar Messages

  • UNIX: problem running an DEV & QA environment using form/report servlets

    UNIX: problem running an DEV & QA environment using form/report servlets
    I am trying to setup on one server an DEV and QA environment using the Forms Servlet, Forms Listener Servlet and Report Servlet.
    I think I have the Forms Servlet and Forms Listener Servlet running properly. The problem is setting up the DEV and QA environment for running reports.
    For example, when in DEV environment I would like to run a report from a directory specified in the REPORTS60_PATH. This doesn't seem possible.
    It might be easier if I describe my configuration first:
    DEV: run all forms and reports from the directory /data/release/dev
    QA: run all forms and reports from the directory /data/release/qa
    ---DEV & QA Settings Forms Listener Servlet:
    zone.properties:
    # DEV
    servlet.fl60dev.code=oracle.forms.servlet.ListenerServlet
    servlet.fl60dev.initArgs=EnvFile=/u01/app/oracle/product/ias/6iserver/forms60/server/dev.env
    # QA
    servlet.fl60qa.code=oracle.forms.servlet.ListenerServlet
    servlet.fl60qa.initArgs=EnvFile=/u01/app/oracle/product/ias/6iserver/forms60/server/qa.env
    ---DEV & QA Settings Forms Servlet:
    servlet.f60servlet.code=oracle.forms.servlet.FormsServlet
    --- Settings for Reports Servlet:
    servlet.RWServlet.code=oracle.reports.rwcgi.RWServlet
    Custom Env files since we are using Developer 6i Patch 7
    dev.env and qa.env
    Here I specify FORMS60_PATH and REPORTS60_PATH,
    eg: DEV -> FORMS60_PATH=/data/release/dev
    REPORTS60_PATH=/data/release/dev
    likewise for QA ../qa
    In the formsweb.cfg file i have something like:
    [dev]
    serverURL=/servlet/fl60dev
    form=test.fmx
    [qa]
    serverURL=/servlet/fl60dev
    form=test2.fmx
    I have tested the following and they work without problems:
    1. forms listener test page, eg: http://webserver:7777/servlet/fl60dev
    2. running forms from the 2 environments
    eg: http://webserver:7777/servlet/f60servlet?config=dev
    this runs the form in the FORMS60_PATH (/data/release/dev)
    Now my problems start with Reports.
    When I run a report from forms (using run_report_object) it will not run any reports
    as specified in the REPORTS60_PATH
    Even using this url:
    http://webserver:7777/servlet/RWServlet?server=rep60&report=test.rdf&destype=cache&desformat=html&
    userid=scott/tiger@test9i
    It NEVER seems to pickup and use the REPORTS60_PATH. I have tried nearly everything.
    I have gone throught the instructions in "Integrating Oracle9iAS Reports in Oracle9iAS Forms -
    White Paper"
    (http://otn.oracle.com/products/forms/pdf/277282.pdf)
    and Forms6i Patch 7: Oracle Forms Listner Servlet for Deployment of FOrms on the Internet
    (http://otn.oracle.com/products/forms/pdf/p7listenerservlet.pdf)
    plus any other documents in metalink relating to forms, or report servlets. I am
    totally confused, please help.
    I have tried setting the REPORTS60_PATH in the following files without success:
    custom.env (as specified by initArgs=EnvFile in zone.properties)
    jserv.properties
    in the zone.properties I have tried to set a custom env file for the report servlet:
    servlet.RWServlet.code=oracle.reports.rwcgi.RWServlet
    servlet.RWServlet.initArgs=EnvFile=/u01/app/oracle/product/ias/6iserver/forms60/server/dev_rep.env
    NO LUCK.
    The only place that I can set the REPORTS60_PATH
    is in "[6iserver home]/reports60_server" file when I start the reports server (did I even
    get this right - I do have to have a reports server running don't I?)
    Does this meaan I have to run multiple report servers for each of my environments?
    Based on all the documentation I thought that REPORTS60_PATH as specified in the files relating
    to the forms servlet would be the place to specify the path.
    As you will understand I am getting really fustrated with this and it seems to
    me that the reports servlet configuration in 6i is really half baked and since 9i
    is coming out it will never be fixed.

    I am even not able to run forms servlets from two different forms60_path, Is there any configuration do you make other than what you have mentioned in this post.
    I already open a TAR in this regard, I am still waiting reply from ORACLE.
    Thanks,
    Shaik Ather Ahmed

  • How to upload more than 100mb in using com.oreilly.servlet package

    hi all,
    I use com.oreilly.servlet package to upload and i use the following code to upload
    MultipartRequest mr = new MultipartRequest(request,"/tmp/saved",0x10000000);My problem is i can't upload more than 25mb, uploads upto 25mb and shows page cannot displayed err in IE,
    Pls help

    In the webserver there is most likely a configuration option for the maximum size that a request may have. So search through the manual of your particular webserver on how to change that.

  • How can i upload a image file to server by using jsp or servlet.

    Hi,
    I m gurumoorthy. how can i upload a image file to server by using jsp or servlet without using third party API. pls anyone send me atleast outline of the source code.
    Pls send me anyone.
    Regards,
    Gurumoorthy.

    I'm not an applet programmer so I can't give you much advice there.
    If you want to stream the file from the server before it's entirely uploaded, then I don't believe you can treat it like a normal file. If you're just wanting to throw it up there and then listen to it, then you can treat it like a normal file.
    But again, I'm not entirely certain. You might be able to stream the start of the file from the server while you're still uploading the end of it, but it probably depends on what method you're using to do the transfer.

  • Need a good charting library (for use in a servlet/jsp environment)

    Anyone know of a good charting library for use in a servlet/jsp environment.

    Use JFreechart combined with cewolf.
    www.object-refinery.com/jfreechart/
    To use charts in a jsp page you can use cewolf ( a taglib) based on jfreechart.
    http://cewolf.sourceforge.net/
    Both are free.

  • How to use JNI with Servlets

    Hi
    i was trying to do some example with JNI. I can use JNI with standalone Java application but I just cannot figure out how I can use JNI with Servlet.
    Can some one show me a sample code using JNI with Servlets.
    thanks very much

    hi,
    I am also facing the same problem,
    when I am using JNI with stand alone application it works fine but when i tried to use it with a servlet It gives unsatisfied linker error
    stack: java.lang.UnsatisfiedLinkError: createSocket
         at RelayConnector.createSocket(Native Method)
         at RelayServlet.doGet(RelayServlet.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:891)
         at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:458)
    It seems i have to do some path settings in my iplenet web server.
    If some one have faced the problem i would be glad to know the solution for this, i am literally bugged up,....

  • Can we use threads in servlets

    Hi,
    can we use threads in servlets.
    cheers
    Sen

    You can also use java.io.Serializable at the end of you class
    eg:
    public class MyClass implements java.io.Serializable{

  • Implementing  jdbc using jsp and servlets

    please give me documnetation and few programs with code .
    implementing or using jdbc with servlets and jsp.

    please give me documnetation and few programs with
    code .
    implementing or using jdbc with servlets and jsp.Well, which do you want to do? Implement JDBC with servlets and JSP - a tricky job, but there's no technical reason why you couldn't for instance write a class which both extends HttpServlet and implements java.sql.Driver. Wouldn't recommend it, though

  • I would like to use removable hard disk drive (portable hard disk) for iphone because of many data, report and so on. I want to receive data for e-mail, so the iphone holds large amounts of data for a long time, and i want to use its at any time

    nowadays, people use removable hard disk drive (portable hard disk) & usb flash drive at computer because of usability, easy to carry around.
    so, i would like to use these functions for iphone. i want to develop mini portable hard disk for the use of iphone like computer

    Not a feature of iphone.

  • Error using XSQL 10 servlet

    I am using the XSQL servlet from the xdk_nt_10_1_0_2_0_production.zip package. When I run a example I always get the following error (NoSuchMethodError) I am using the xmlparserv2.jar from the xdk\lib dir. What could be wrong?
    java.lang.NoSuchMethodError
    at oracle.xml.util.QxName.<init>(QxName.java:65)
    at oracle.xml.util.QxNameHash.add(QxNameHash.java:116)
    at oracle.xml.util.QxNameHash.create(QxNameHash.java:72)
    at oracle.xml.parser.v2.XMLEntity.<init>(XMLEntity.java:136)
    at oracle.xml.parser.v2.XMLEntity.<init>(XMLEntity.java:156)
    at oracle.xml.parser.v2.DTD.<clinit>(DTD.java:1031)
    at oracle.xml.parser.v2.NonValidatingParser.<init>(NonValidatingParser.j
    ava:155)
    at oracle.xml.parser.v2.XMLParser.<init>(XMLParser.java:150)
    at oracle.xml.parser.v2.DOMParser.<init>(DOMParser.java:84)
    at oracle.xml.xsql.XSQLParserHelper.parse(XSQLParserHelper.java:104)
    at oracle.xml.xsql.XSQLConfigManager.reloadConfigFile(XSQLConfigManager.java:315)

    I am also getting the same error with the following call;
    OracleXMLSave xs2 = new OracleXMLSave(this.dbConnection,
    LimitsWorkflowXDKObjectDAO.LIMITS_WF_O_TABLE);
    if ( xs2 == null ) System.out.println("XML_SAVE IS NULL");
    else
    xs2.setKeyColumnList(pkArray);
    xs2.setIgnoreCase(true);
    xs2.setRowTag(LimitsWorkflowXDKObjectDAO.LIMITS_WF_O_ROW_TAG);
    if (dateFormat != null)
    xs2.setDateFormat(dateFormat);
    rows = xs2.insertXML(xmlDoc);
    javax.xml.namespace.QName.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
         at oracle.xml.util.QxName.(QxName.java:65)
         at oracle.xml.util.QxNameHash.add(QxNameHash.java:116)
         at oracle.xml.util.QxNameHash.create(QxNameHash.java:72)
         at oracle.xml.parser.v2.XMLEntity.(XMLEntity.java:136)
         at oracle.xml.parser.v2.XMLEntity.(XMLEntity.java:156)
         at oracle.xml.parser.v2.DTD.(DTD.java:1031)
         at oracle.xml.parser.v2.NonValidatingParser.(NonValidatingParser.java:155)
         at oracle.xml.parser.v2.XMLParser.(XMLParser.java:150)
         at oracle.xml.parser.v2.DOMParser.(DOMParser.java:84)
         at oracle.xml.sql.dml.OracleXMLSave.initParser(OracleXMLSave.java:300)
         at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2370)
         at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1352)

  • Should I use JSP,JSTL,SERVLETs without a framework?

    Hi Guys
    I'm making a multi player browser game. The game will have some forms to setup data into the database and the player will be able to check other players data.
    I will load the players data from the DB into a Bean when the application starts and then just get the other players information from DB when and if asked.
    I'm planing on doing it as MVC2 using JSP, JSTL, SERVLETs, BEANs
    Would you recommend me to use Struts for example? should I just use it without any framework?
    I read a lot about Struts and can't really see what it can bring to an application like mine. I can use the i18n easily with JSTL and for few validation of forms I don't know if it's worth it.
    What do you think? (-:
    Thanks in advance
    (-:

    If your going to use MVC2 then I would use a framework, otherwise where are you going to get your MVC from, were you planning on writing an MVC yourself?

  • Code webservices in WLS 6.1 sp2 using apache soap servlet

    Please let me know the steps necessary to use the soap servlet from apache while
    coding the webservices.
    Thanks
    Vaneet

    Please let me know the steps necessary to use the soap servlet from apache while
    coding the webservices.
    Thanks
    Vaneet

  • Why we are using init() in servlet

    why we are using init() in servlet
    Instead of doing in init() we can do that things in Constructor

    Hi
    In order ti be clear. Do you remeber the applet lfe cycle ?. An applet run inside a browser and a servelts runs inside a servlet container, so is the servelt container who instatiate a servlet, init and destroy, and while servlet is alive calls doService inside a thread.
    The mechanism to fill some parameters or other task is by writing the init(ServletConfig) method inherited from GenericServlet.
    To clear parameters or other clearing stuff you can use the destroy method, inherited from GenericServlet
    Hope this helps

  • Should I install Apache Web server to use Jakarta Tomcat Servlet engine?

    Hello,
    I have some problems and now have a question:
    Should I install Apache Web server to use Jakarta Tomcat Servlet engine?
    JTK home page is available via http://localhost:8080
    Tomcat ver 3.1.3
    Thanks.

    No, you don't need to run Apache webserver (httpd) to run Tomcat. Tomcat by default runs on port 8080, but you can set it to any port, including 80, if you have permission to do so (on *nix systems, you need root permissions to run services on any port below 1024).
    Tomcat is a webserver as well, just one that includes a servlet container and JSP processor. So it will serve your html files, images, etc (aka static content), just as well as Apache httpd, in addition to being able to run servlets and JSPs.
    Apache httpd has more options for serving static content than Tomcat, so many people prefer to use it as their main webserver and only use Tomcat as a sort of "plugin" to handle servlets and JSPs. This can be achieved through a connector. Instructions on how to set this up are on the Jakarta website.
    So you could use Apache and Tomcat combined, next to each other, or totally separated. In many cases, just Tomcat will do.

  • What is the best editor to use for JSP/Servlet?

    Hello,
    What is the best editor to use for JSP/Servlet database development.
    I'm looking at Dreamweaver,Java Studio Creator.
    I want some thing fairly easy to use that has database helper wizards like dreamweaver.
    Thanks for the help.
    Frank

    Is it better to have a servlet do the database work and call it from JSP?No, it's better to have persistence objects do the database work. Servlets handle HTTP requests, and JSPs are HTML factories that should be pure view.
    But there are lots of ways to do things. You just have to understand the tradeoffs when you decide.
    I do not want to hammer out code, I want to learn the
    best way to do things from experienced developers. Sorry, sounded like you just wanted to churn stuff.
    "best way" can be subjective. In one app, "best" might be "delivered fastest". For another, "best" might be "most secure" or "most easily modified" or "best performing" or whatever. You won't get a "best" answer, only different choices. And they aren't always so easy to explain or execute.
    I'd recommend that you start by reading about layered applications (3-tier architectures) and MVC separation. Once you've Googled enough about that, look into a framework like Struts or Spring or WebWork. That'll help you figure out where to put each responsibility in your app.
    I can use dreamweaver to create web apps, but I hate
    the arrays used to define fields. It also seems not
    to take advantage of connection pooling.Don't know what you're talking about here, Frank. What do fields have to do with connection pooling?
    %

Maybe you are looking for