Uusing Beans to hold Database connection objects

Hi,
I am kind of new to Java. I wanted to create a db connection object and use the same in the rest of the pages within the session.
In the first page I got the connection object and along with other values I created a bean with scope session and stored the connection object using the setProperty method.
In the next page I retrieve the values using the getProperty method and pass the connection object to a method which updates the database.
When I execute this I get a Runtime error pointing to the method invoked. When I execute the method in standlone mode calling from main method it executes fine.
Can anyone tell me if there is a problem when storing and retrieving objects using the setProperty and getProperty methods.
Regards
VM

For application listeners, see http://www.onjava.com/pub/a/onjava/2001/04/12/listeners.html and also JavaDocs at sun.( ServletContextListener class is in javax.servlet package )
You should do the initialization and putting the instance in application scope in public void contextInitialized(...) method of your listener, by for example block of code like,
public void contextInitialized( ServletContextEvent sce ) {
     // Gettin' your servlet context object for current web application
     ServletContext application = sce.getServletContext();
     // instanciate your DB bean
     MyDataPool db = MyDataPool.getInstance();
     // puttin' instance in scope for later use
     application.setAttribute( "db", db );
This causes you when needed, use ServletContext's getAttribute( "db" ) method to retrieve your database.
for now you just need to add to your "web.xml" <listener> element for your listener class.
<listener>
     <listener-class>mypackage.MyServletContextListener</listener-class>
</listener>
i hope these helps ;)

Similar Messages

  • Passivation of Connection Object in Stateful Session Bean

    Hi all,
    I am developing a Stateful session bean that has a Connection object as its instance variable. And this bean starts transaction that spans across multiple method calls and finally either commit or rollback.
    BeanClass
    UserTransaction utx;
    Connection conn;
    ejbCreate()
    allocateconnection();
    ejbRemove()
    closeconnection();
    ejbActivate()
    allocateconnection();
    ejbpassivate()
    closeconnection();
    StartTransaction()
    utx = getusertransaction();
    utx.begin();
    Method1()
    do something with database
    Method2()
    do something with database
    CommitTransaction()
    utx.commit();
    For example, the typical usage of this bean would be:
    bean.StartTransaction();
    bean.Method1();
    bean.Method2();
    bean.CommitTransaction();
    Here are my two questions:
    1. General Question: In order for a Connection object to join a Transaction, Do I have to create the connection after the transaction has started?
    2. If the answer to the above question is yes, then: I understand that when this bean get passivated, the UserTransaction instance object would be passivated. And since the connection object can't not be passivated, I have to recreate the connection object in ejbactivate() method, would newly created connection participate in the same Transaction that was being passivated and now activated?

    >
    Hi all,
    I am developing a Stateful session bean that has a
    Connection object as its instance variable. And this
    bean starts transaction that spans across multiple
    method calls and finally either commit or rollback.
    BeanClass
    UserTransaction utx;
    Connection conn;
    ejbCreate()
    allocateconnection();
    ejbRemove()
    closeconnection();
    ejbActivate()
    allocateconnection();
    ejbpassivate()
    closeconnection();
    StartTransaction()
    utx = getusertransaction();
    utx.begin();
    Method1()
    do something with database
    Method2()
    do something with database
    CommitTransaction()
    utx.commit();
    For example, the typical usage of this bean would be:
    bean.StartTransaction();
    bean.Method1();
    bean.Method2();
    bean.CommitTransaction();
    Here are my two questions:
    1. General Question: In order for a Connection object
    to join a Transaction, Do I have to create the
    connection after the transaction has started?Strictly NO. In fact, the connection is obtained first and then can a transaction begin.
    2. If the answer to the above question is yes, then: I
    understand that when this bean get passivated, the
    UserTransaction instance object would be passivated.
    And since the connection object can't not be
    passivated, I have to recreate the connection object
    in ejbactivate() method, would newly created
    connection participate in the same Transaction that
    was being passivated and now activated?
    The answer to first question being NO, your argument for question 2 does not hold true. According to the EJB specification, a stateful session bean can only be passivated between the transaction and not within a transaction. Your implementation for the stateful EJB is good to work.

  • Jsp and database connection using bean

    * I want create a bean to handle database connectivity.The
              <jsp:usebean> tag uses
              no argument constructor ..so I cannot pass the userid and password to
              the constructor.
              So how can I create a database connection when the user_id and password
              will be a part of parameter ?
              * Now I'm opening database connection in the jsp scriplets. Everytime I
              refresh the
              jsp page a new connection is created ? Is it not going to choke the
              database ? I cannot use connection pool because every user logs in with
              different userid.
              Thanks
              

    You can pass your arguments in this way:
              <jsp:usebean id="myBean" scope="page"/>
              <jsp:setProperty name="myBean" property="userId", value=<%= user_id%>/>
              <jsp:setProperty name="myBean" property="password", value=<%=
              user_password%>/>
              of course, in your bean class, you should create two setter methods,
              setUserId and setPassword.
              Hopefully, this will help you.
              sonia WEN
              Chiranjib Misra wrote:
              > * I want create a bean to handle database connectivity.The
              > <jsp:usebean> tag uses
              > no argument constructor ..so I cannot pass the userid and password to
              > the constructor.
              > So how can I create a database connection when the user_id and password
              > will be a part of parameter ?
              >
              > * Now I'm opening database connection in the jsp scriplets. Everytime I
              > refresh the
              > jsp page a new connection is created ? Is it not going to choke the
              > database ? I cannot use connection pool because every user logs in with
              > different userid.
              >
              > Thanks
              

  • Serialization of an Object containing an opened database connection

    Hi everyone,
    My question is simple:
    If you serialize an object containing an active databse connection, will it be de-serialized with that connection active and ready to use?

    First of all, lets look at the purpose. what is that
    making you write an object which hold the Connection
    object to a network or to the file.
    First check the condition. The conditions for
    serialization are
    1) Connection object should not be declared as
    transiant.
    2) And it should not be as static.
    It the above conditions are meet then the it is
    serializable.
    Now the obejct holding the connection object is
    written to the file or over the n/w.
    Reading
    Case 1 ) You read from the file at the server end no
    issues. You can reconstruct the Connection object and
    use it.
    case 2) If you are writing to the n/w , your client
    is some where in Aus and the java server the db
    server are in US. Java Server being public and db
    server being local to the Java Server , how you
    would use the connection object to execute the querys
    on that DB.
    Think about this :).Hi,
    Are n't you missing the whole point here? What you've said above is valid , of course, but then your readObject/writeObject methods would take care of restoring the connection object (from wherever) if such an implementation is taken up. IMHO, such an implementation is not practical in the first place, and if it's required in your project, it's bad design.
    Regards
    Hrishikesh

  • Database connection pooling with weblogic 8.1.

    Hai All,
    I am new to weblogic database connection pooling.
    I am using Weblogic8.1 and want to use connection pooling to get a jdbc connection. my database server is Oracle 8.1.7.
    Things which i have done using the weblogic admin console.
    I have created a Jdbc connection pool named myconnectionpool.
    I have created a datasource named mydatasource.
    and named the JNDI as myjndi.
    Is the above process correct to create the connection pool in the weblogic8.1.
    I am not aware of the java code to get the database connection object from the connection pool which i have created.
    can any one please let me know the java code to get the connection from the pool.
    Any help is appreciated
    Thanks in advance
    pooja.

    Hai
    I have tried using the code u have mentioned but it returned me
    an error which is below.
    C:\javaexamples\Javaprograms\JDBC>java jdbcexampleconnectionpool
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    I have added the following lines code, which i read in some weblogic documentation. The code i added is below and it worked fine.
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
    Context ctx = new InitialContext(ht);I am not sure what the above code does.
    Can anyone let me know what does the above code do.
    Thanks a lot and i appreciate ur help,
    Pooja.

  • Lot of DataBase connections

    Hi,
    I am using OC4J as web container and Oracle 8i database on Sun solaris. I am using following scheme to access database connection.
    I have one Properties file that carries information about the driver,url,user and password
    I have one class RDBMServices. In constructor I reads that properties file. I have one getConnection method that setup connection Following is the code
    * Gets a database connection
    * @return a database Connection object
         public static Connection getConnection()
         Connection conn = null;
              try
                   Class.forName (sJdbcDriver);
    conn = DriverManager.getConnection (sJdbcUrl, sJdbcUser, sJdbcPassword);
              catch ( Exception e )
              System.out.println(e);
              return conn;
    I also have one method that is used to release connection.
    * Releases database connection
    * @param a database Connection object
         public static void releaseConnection (Connection con)
              try
    if (con != null)
              con.close();
              catch ( Exception e )
    Ok now in every JSP page where I need database access, I just create object of RDBMServices and execute queries on it. When I am done then I just call releaseConnectio() method to release that connection. So I am doing this in every JSP page. My problem is that I have lots of database connection open eventhoug I am releasing connection. For example I ran 50 users test and they Open 150 connection becasue every user goes through three pages. Please help me how I can get rid of this problem. THANKS
    Faizan

    This example demonstrates how to configure a JDBC source and how to make a
    JNDI lookup to access it. This example assumes you are using the scott database
    user and EMP table exists in SCOTT schema.
    1. Create an new entry in the $J2EE_HOME/config/data-sources.xml file as
    follows. Make appropriate changes to the connection information.
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="OracleDS"
    location="jdbc/OracleDS"
    xa-location="jdbc/xa/OracleXADS"
    ejb-location="jdbc/OracleDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="scott"
    password="tiger"
    url="jdbc:oracle:thin:@localhost:1521:ORCL"
    inactivity-timeout="30"
    />
    2. The following Servlet (GetDSUsingJNDI.java) demonstrates how to make a
    JNDI lookup to retrieve a JDBC data source named "jdbc/OracleDS".
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import javax.naming.*;
    import java.sql.*;
    import javax.sql.*;
    public class GetDSUsingJNDI extends HttpServlet {
    InitialContext context = null;
    DataSource jdbcURL = null;
    Connection conn = null;
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    // Obtain connection using JNDI Lookup
    try {
    context = new InitialContext();
    jdbcURL = (DataSource) context.lookup("jdbc/OracleDS");
    catch(NamingException e)
    throw new ServletException("Error looking Data Source", e);
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = new PrintWriter (response.getOutputStream());
    out.println("<html>");
    out.println("<head><title>Getting Data Source using JNDI Lookup</title></head>");
    out.println("<body><H1>Getting Data Source using JNDI Lookup</H1>");
    // Connect to the database
    try {
    Connection conn = jdbcURL.getConnection();
    out.println("Connected to database successfully ..");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT ename FROM emp");
    out.println("Results of the query");
    // Display Results of the SQL Query
    while ( rs.next() ) {
    out.println( "<br>" + rs.getString("ename") + "<br>");
    conn.close();
    catch(SQLException e)
    throw new ServletException("Error connecting to Database", e);
    out.println("</body></html>");
    out.close();
    3. Compile the servlet using javac.
    D:\j2ee\home>set CLASSPATH=D:\j2ee\home\orion.jar;D:\j2ee\home\jndi.jar;D:\j2ee\home\lib\classes12.jar
    D:\j2ee\home>javac GetDSUsingJNDI.java
    You have to include D:\j2ee\home\jndi.jar in the libraries for the project
    properties for the project in the Jdeveloper to compile this in Jdeveloper.
    4. Deploy the servlet on OC4J by copying the GetDSUsingJNDI.class to:
    <9iAS ORACLE_HOME>\j2ee\home\default-web-app\WEB-INF\classes
    5. Run your GetDSUsingJNDI Servlet and your servlet should be able to
    connect to the database successfully.
    http://localhost:8888/servlet/GetDSUsingJNDI
    regards
    Debu Panda
    Oracle

  • Clean-up code - Close Database Connection

    I have a Stateless Session Bean that implements a Web Service. This bean opens a database connection. I need to close it before the application is undeployed or the Application Server (Glassfish) is restarted, etc. I have tried shutdown hooks, predestroy and preremove annotations but none of it works.
    In a few words, I want to release resources when they are not needed, but not before that.
    I have used Google in every way I can imagine but I haven't turned up with anything.
    Any ideas?

    Duffy, I appreciate your reponse on this issue. But what is the difference, seeing that a stateless bean is response-oriented afterwhich it is returned to the pool. Not sure I know what you mean here.
    A pool of connections is not the same as a pool of stateless session beans. And I don't think that returning an instance of one to its pool necessarily means that the other is automagically cleaned up as well.
    I will admit now that I'm not an EJB expert.
    It almost seemed to me that you were saying you'd recommend making the size of the connection and SLSB pools identical. You'd dedicate one connection to each SLSB, marrying the two together for as long as ye both shall live.
    I think the design will make acquiring a connection littered all over code body. If the connection will be reused in at least 2 method it is better to create the connection in the postConstruct annotated method and remember after the bean services the client request, it is in itself placed in a pool. So nothing is lost.Maybe you're right. I'm not much with EJBs. I use Spring exclusively.
    %

  • Packaging a Database Connection Class

    Hi,
    I am trying to create a database connection class, which allows me to establish a database connection and subsequently uses this connection to query the database.
    The code for the package is as follows:
    package com.mycom.javaloader;
    import java.io.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.mycom.javaloader.*;
    public class DatabaseConnection
    // Database connection objects
    private Connection DatabaseConnection;
    private Statement DatabaseStatement;
    private String ConnectionString;
    // Object constructor
    public DatabaseConnection (String HostName, String DatabasePort, String DatabaseName) throws SQLException, IOException
    ConnectionString = "jdbc:oracle:thin:@" + HostName + ":" + DatabasePort + ":" + DatabaseName;
    public boolean ConnectDatabase () throws SQLException, IOException
    try
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    DatabaseConnection = DriverManager.getConnection (ConnectionString, "psicpk", "psicpk");
    DatabaseStatement = DatabaseConnection.createStatement ();
    System.out.println ("Database connection OK");
    return true;
    catch (SQLException e)
    System.out.println ("Database connection failed");
    return false;
    public static void main (String args[]) throws SQLException, IOException
    CustomFile LogFile = new CustomFile ("LogFile.txt", "Output");
    DatabaseConnection PSIConnection = new DatabaseConnection ("10.80.45.93", "1521", "psicpk");
    PSIConnection.ConnectDatabase (LogFile);
    LogFile.CloseFile();
    The odd thing is, when I compile the above as a program (by removing the package statement), it works fine. But, when I compile it as a package and instantiate the class in another program, I get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    at com.mycom.javaloader.DatabaseConnection.ConnectDatabase(Datab
    aseConnection.java:35)
    at TestPackage.main(TestPackage.java:35)
    I didn't think it is any problem with my CLASSPATH setting, as the program runs well on its own.
    Is there any code I need to change when accessing JDBC connections in a package?
    Please help.
    Thanks and regards,
    SiowLing

    No, you don't need to put all the required classes in the same directory. Just include them in the classpath and it should work.
    You can check whether you required classes are in the path or not, as follows,
    commandPrompt:\>javap <full.path.ClassNameofTheClasses12.jar> <enter>
    this should show you all the public methods, variables etc. if the Class is in the path, otherwise "Class /<full.path.ClassNameofTheClasses12.jar>' not found" will be displayed.
    Regards,
    Ketan

  • Share database connection between servlets

    hello,
    i need help to know if the following code works well.
    The intention is to share a unique JDBC database connection with all servlets of my application.
    //************************ file Conexao.java ***********************
    // this class makes a databse connection
    import java.sql.*;
    public class Conexao
    Connection conex;
    public void conecta()
    try
    Class.forName("interbase.interclient.Driver");
    conex = DriverManager.getConnection("jdbc:interbase://localhost/c:\\temp\\Kuala.gdb","SYSDBA","masterkey");
    catch(ClassNotFoundException ex) { }
    catch(SQLException ex) { }
    public void desconecta()
    try
    { conex.close(); }
    catch(SQLException ex) { }
    //****************** file SetConnectionContext ****************
    // this class creates an instance of Conexao class and invokes the
    // conecta() method. After, obtain the ServletContext object and
    // set the attribute "conecta" to the ServletContext
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class SetConnectionContext extends HttpServlet
    Conexao connection = null;
    public void init()
    connection = new Conexao();
    connection.conecta();
    ServletContext context = getServletContext();
    context.setAttribute("conecta", connection);
    public void destroy()
    { connection.desconecta(); }
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.setContentType("text/html");
    PrintWriter saida = response.getWriter();
    saida.println("<H1>objeto connection atribuido no contexto</H1>");
    //****************** file GetConnectionContext.java ******************
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class GetConnectionContext extends HttpServlet
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.setContentType("text/html");
    PrintWriter saida = response.getWriter();
    ServletContext context = getServletContext();
    Conexao con = (Conexao) context.getAttribute("conecta");
    try {
    Statement comando = con.conex.createStatement();
    ResultSet rs = comando.executeQuery("SELECT * FROM kl_campanha");
    while( rs.next() )
    int codCampanha = rs.getInt("codCampanha");
    saida.println("<h3>"+codCampanha+"</h3>");
    catch(Exception e) { }

    I understand the use of a static variable.
    But if i want to share a database connection object (a
    instance varible instead of class variable) that is
    instantiate once and saved in a ServletContext
    attribute,
    and afterwards the other servlets can get
    the object through the ServletContext attribute and
    use it. This will works well? i did tests with the
    code and everything apparently works.
    How does a new connection (different user) get the old context?

  • Help! My database connection from BMP Entity bean dies after a while!!!

    Hi all!
    I posted a related post about this lately How do I use connection pooling from BMP Entity Beans in OC4J 10.1.2? but it didn't solve my problems.
    I have some entity beans coded with BMP, so I handle all database stuff myself. I have set up datasources.xml like this:
        <data-source
            class="com.evermind.sql.DriverManagerDataSource"
            name="OracleDS"
            location="jdbc/OracleCoreDS"
            xa-location="jdbc/xa/OracleXADS"
            ejb-location="jdbc/OracleDS"
            connection-driver="oracle.jdbc.driver.OracleDriver"
            username="scott"
            password="tiger"
            url="jdbc:oracle:thin:@//URL TO DB:SID"
            inactivity-timeout="30"
            min-connections="10"
            max-connections="50"
        />All JNDI connection lookup is done through the ejb-location as I should. I have been through all my try {} catch {} finally {} blocks, so ensure that I close all objects after use.
    After a few hours of inactivity, my program dies. I have inserted a lot of debug statements (System.out.println()), and it seems like the program hangs when it's trying to execute a PreparedStatement.
    I.e. it dies when I do ps.ExecuteQuery in the code below (NOTE: to make things easier to read, I have stripped out all error handling here):
        Context ic = new InitialContext();
        DataSource ds = (DataSource)ic.lookup("jdbc/OracleDS");
        c = ds.getConnection();
        System.out.println("DEBUG: Got database connection.");
        PreparedStatement ps = c.prepareStatement("SELECT foobar FROM footable WHERE foo=?");
        System.out.println("DEBUG: Prepared SQL statement.");
        ps.setString(1,"foo");
        ResultSet rs = ps.executeQuery();
        // Close all objects (rs, ps, c) here.My database is on another physical server, so I wonder if this is caused by an unstable network, or?
    Please help!
    ~Morten

    Hi again!
    Sorry for the delay, but I have been busy lately.
    Anyway: Our application server is 10.1.2, so I don't think patch 4307303 is relevant here. Database server is Oracle 9.2.0.6. Everything runs on Linux (of course) ;-).
    Here's a thread dump:
    Full thread dump Java HotSpot(TM) Server VM (1.4.2_04-b05 mixed mode):
    "ApplicationServerThread-8" prio=1 tid=0x089a9448 nid=0x5902 in Object.wait() [885e6000..885e687c]
         at java.lang.Object.wait(Native Method)
         at EDU.oswego.cs.dl.util.concurrent.SynchronousChannel.poll(SynchronousChannel.java:353)
         - locked <0x91a31e60> (a EDU.oswego.cs.dl.util.concurrent.LinkedNode)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor.getTask(PooledExecutor.java:767)
         at com.evermind.util.ReleasableResourcePooledExecutor.myGetTask(ReleasableResourcePooledExecutor.java:151)
         at com.evermind.util.ReleasableResourcePooledExecutor.access$000(ReleasableResourcePooledExecutor.java:33)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:190)
         at java.lang.Thread.run(Thread.java:534)
    "AJPRequestHandler-ApplicationServerThread-7" prio=1 tid=0x08d78a58 nid=0x5902 runnable [8b2f4000..8b2f587c]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at oracle.net.ns.Packet.receive(Unknown Source)
         at oracle.net.ns.DataPacket.receive(Unknown Source)
         at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:978)
         at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:950)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:434)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:661)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:959)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:693)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1065)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2901)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2942)
         - locked <0x914cad08> (a oracle.jdbc.driver.T4CPreparedStatement)
         - locked <0x920256c0> (a oracle.jdbc.driver.T4CConnection)
         at com.evermind.sql.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:270)
         at com.evermind.sql.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:270)
         at com.evermind.sql.PreparedStatementBCELProxy.executeQuery(PreparedStatementBCELProxy.java:31)
         at com.brunata.servicerapport.ejb.CustomerBean.ejbCreate(Unknown Source)
         at CustomerLocalHome_EntityHomeWrapper2.create(CustomerLocalHome_EntityHomeWrapper2.java:420)
         at com.brunata.servicerapport.BeanFactory.getCustomerBean(Unknown Source)
         at com.brunata.servicerapport.CustomerOpenAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at com.brunata.servicerapport.CustomerAuthorizationFilter.doFilter(Unknown Source)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    "Thread-23" daemon prio=1 tid=0x092ebb18 nid=0x5902 in Object.wait() [88565000..8856587c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x920000f0> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <0x920000f0> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "Thread-22" daemon prio=1 tid=0x092eb988 nid=0x5902 in Object.wait() [8dfa0000..8dfa087c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92000188> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <0x92000188> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "AJPRequestHandler-ApplicationServerThread-6" prio=1 tid=0x08c03240 nid=0x5902 runnable [8b0f1000..8b0f187c]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at com.evermind.io.SingleReadBufferInputStream.readChunk(SingleReadBufferInputStream.java:116)
         at com.evermind.io.SingleReadBufferInputStream.read(SingleReadBufferInputStream.java:35)
         at com.evermind.server.http.AJPRequestHandler.readAJPPackets(AJPRequestHandler.java:462)
         at com.evermind.server.http.AJPRequestHandler.initRequest(AJPRequestHandler.java:396)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:185)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    "DestroyJavaVM" prio=1 tid=0x08053278 nid=0x5902 waiting on condition [0..bfffcac4]
    "OC4JMonitorThread" daemon prio=1 tid=0x08d7a5a0 nid=0x5902 in Object.wait() [88667000..8866787c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92aed1f8> (a java.lang.Object)
         at oracle.ons.NotificationQueue.internalDequeue(NotificationQueue.java:253)
         - locked <0x92aed1f8> (a java.lang.Object)
         at oracle.ons.NotificationQueue.dequeue(NotificationQueue.java:226)
         at oracle.ons.Subscriber.receive(Subscriber.java:136)
         at com.evermind.server.OC4JMonitorThread.run(OC4JMonitorThread.java:315)
         at java.lang.Thread.run(Thread.java:534)
    "Thread-6" daemon prio=1 tid=0x087f9f98 nid=0x5902 in Object.wait() [886e8000..886e887c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92aed368> (a java.lang.Object)
         at java.lang.Object.wait(Object.java:429)
         at oracle.ons.NotificationQueue.internalDequeue(NotificationQueue.java:255)
         - locked <0x92aed368> (a java.lang.Object)
         at oracle.ons.NotificationQueue.dequeue(NotificationQueue.java:215)
         at oracle.ons.SenderThread.run(SenderThread.java:81)
    "Thread-5" daemon prio=1 tid=0x087f9d10 nid=0x5902 runnable [88769000..8876987c]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at oracle.ons.InputBuffer.readMoreData(InputBuffer.java:267)
         at oracle.ons.InputBuffer.getNextString(InputBuffer.java:222)
         at oracle.ons.ReceiverThread.run(ReceiverThread.java:228)
    "TaskManager" prio=1 tid=0x087f9b30 nid=0x5902 waiting on condition [887ea000..887ea87c]
         at java.lang.Thread.sleep(Native Method)
         at com.evermind.util.TaskManager.run(TaskManager.java:247)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "Thread-4" prio=1 tid=0x08ca2fb8 nid=0x5902 in Object.wait() [891e2000..891e287c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92aee258> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <0x92aee258> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "AJPConnectionListener [0.0.0.0/0.0.0.0:3302]" prio=1 tid=0x086f1668 nid=0x5902 runnable [8a7ca000..8a7ca87c]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         - locked <0x927a0390> (a java.net.PlainSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at com.evermind.server.http.AJPConnectionListener.run(AJPConnectionListener.java:60)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "RMIServer [0.0.0.0:3202] count:2" prio=1 tid=0x086cbff0 nid=0x5902 runnable [8b172000..8b17287c]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         - locked <0x927a0850> (a java.net.PlainSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at com.evermind.server.rmi.RMIServer.run(RMIServer.java:464)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "JMSServer[webprod:3702]" prio=1 tid=0x0879aff0 nid=0x5902 runnable [8b1f3000..8b1f387c]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         - locked <0x92746aa0> (a java.net.PlainSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at com.evermind.server.jms.JMSServer.run(JMSServer.java:516)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "LogFlusher" daemon prio=1 tid=0x081b91a0 nid=0x5902 waiting on condition [8b274000..8b27487c]
         at java.lang.Thread.sleep(Native Method)
         at oracle.core.ojdl.BufferedLogWriter$Flusher.run(BufferedLogWriter.java:354)
    "Signal Dispatcher" daemon prio=1 tid=0x080ba9e0 nid=0x5902 waiting on condition [0..0]
    "Finalizer" daemon prio=1 tid=0x080b61a8 nid=0x5902 in Object.wait() [8e9a7000..8e9a787c]
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
         - locked <0x925b0378> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=1 tid=0x080b5dc8 nid=0x5902 in Object.wait() [8ea28000..8ea2887c]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:429)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
         - locked <0x925b02a0> (a java.lang.ref.Reference$Lock)
    "VM Thread" prio=1 tid=0x080b52e0 nid=0x5902 runnable
    "VM Periodic Task Thread" prio=1 tid=0x080bee08 nid=0x5902 waiting on condition
    "Suspend Checker Thread" prio=1 tid=0x080b9fc8 nid=0x5902 runnable As far as I can see, my PreparedStatement (or connection) is locked.... Any ideas?
    ~Morten ;-)

  • How can I get Connection(Database Connection)on my backing bean

    hello guys!
    How can I get the Database Connection on my managed bean?
    I want to use this connection for my reports.
    thanks a lot!
    alvin

    Alvin,
    You can access the data provider through ADF the binding. The data provider represents the business service you use. Once you have a handle to this you can get the connection.
    You don't mention the business service, so I cannot help you more than this. If it is ADF BC, have a look at http://download.oracle.com/docs/html/B25947_01/toc.htm and the stored procedure section. Steve Muench explains a trick to access the "real" JDBC connect used by ADF BC
    Frank

  • Losing database connections in remote objects

    Hi,
    I have an interesting problem. I have a couple of remote objects that bear database connections. They are pooled in another remote object and provided by registry on request to the client. However, when I check the connections after a while, all of them are closed except the last client. I enabled logging and discovered that all clients except the last one connected get disconnected at the same moment when the method clean() of the DGC gets invoked. I can even predict the moment, e.g. when I start the server at XX:XX:31, the connections get closed at YY:YY:31, always after whole minutes. Strange thing is, that even active clients currently querying data get disconnected.
    Jezevec
    Has anybody met such a problem already? My configuration is Java 1.3.0_02, database is Oracle 8i. Thanx for any hints.

    My colleague solved it. If anyone interested, the problem was caused by the class com.borland.dx.sql.dataset.Database which is provided in Borland JBuilder libraries. We used it to create connections to the Oracle db. Do not use this class for RMI applications if you want to avoid problems. It's better to rely on standard JDBC classes.
    Jezevec

  • Please help, urgent! How to hold the connection to oracle database

    I used java to connect Oracle database using thin driver. But I found out the connection will be closed very soon if I did not make any request of query. I query the database like after 1 mins without doing anything, my application will dead for about 2 mins, then everything become normal again.
    How can I hold the connection or is there any other solution? thank you!

    Duffy is, as usual, correct. If you have a single-user environment, then holding onto a connection is probably okay (not desirable but also not pernicious). However, once you have more than one user, you will want to use a connection pool. Jakarta Commons (jakarta.apache.org) has an open source pool that is reliable.
    But the fact that you are having additional problems makes me believe you are missing a few fundamental concepts, such as transactions. Even if the connection dropped, you should be able to reconnect without issue (granted, with some additional latency). The only time it would pose an issue (above and beyond the ones mentioned above and in previous replies) is if you are not managing your transactions properly.
    In short, take some tutorials on JDBC, DataSource, connection pools and transaction management.
    - Saish

  • Database connectivity to business objects

    Post Author: kshatri
    CA Forum: Administration
    Hi All,
    I am new to for my first project, having good knowledge about BO but my only concern is with the first day target.
    As a new team mate memeber what are my roles and responsibilites to be done.
    How to interact with the Administrator to get my database connectivity and then how to implement the path provided by the admin people to get my database activate and then to connect it to the business objects.
    So again i am requesting you all if you any one among you, who has already gone through this situation  could help and make to understand how to connect the database to business objects.
    And how to present ourslef in a new environment.
    Thanks,
    Anu.

    Post Author: jsanzone
    CA Forum: Administration
    Anu,
    This is one of those forum threads that could last all year with comments, tips, and criticisms.  If you have a lot of knowledge about BusObjects, then you are nearly half way there.  In my experience, the biggest road block to success is communication and team cohesiveness.  If everyone on the project are not communicating with each other then everything is going to fail.  What do I mean about communication?  It's hard to pin down, but when I see it I'll know it's there (smile).  For starters it's having a good plan that everyone can work from.  An underlying theme in communications is also trust.  The folks who hand out the userids and passwords must be able to trust the folks who are receiving the privileges.  If the administrator must give you read/write access to his or her database and they don't "know" you, then this is an uphill battle.  Many administrators do not understand middleware such as BusObjects, they are more familiar with things like Access, and such -- the more simpler applications.  When you try throwing terms around like business intelligence, single-sign on, multiple queries, data providers, meta data, report viewer, etc, etc their heads start to spin and they want you OUT of their sight.  All of these concepts must be introduced gently and in an appropriate setting.  The admins must get familiar and comfortable with your tools before you can make headway.  So that is what I mean by communication, in this case laterally.  You must also communicate upwards (the C-level folks), and downward, the users.  Like I said, folks could add to this thread infinitum, and I would invite other as such, but here are some things to think about as you move forward.  The best teacher is experience, but who has time for that?

  • OLE Objects and Database Connectivity Toolkit

    I am trying to insert and image (jpg) that is created in Labview into an Access database as an OLE object. How do I go about making this conversion, or are there any other suggestions?

    Hello -
    Have you tried any of the shipping examples for the database connectivity tookit? You can find them by navigating Help >> Find Examples >> Toolsets and Modules >> Database Connectivity. The Insert Example.vi may help you get started. Click here to access database examples posted on the Developer Zone.
    Please let me know if any of these examples helped. If not, can you provide more information about the version of LabVIEW and Access you are using? Thanks! Have a great day!
    Becky B.
    Applications Engineer
    National Instruments
    Becky Linton
    National Instruments
    Field Engineer
    Office: 734-464-2463
    Cell: 248-709-2822
    Email: [email protected]

Maybe you are looking for

  • ADFDi Excel upload failed in a new session

    ADFDi Excel upload failed when a change was made in a locally saved ADFDi Excel file.  This should be a very common disconnected scenario.  I must miss something.  Here are high-level steps that I have done. 1. Open a ADFDi Excel from a ADF page. 2.

  • BPM_DATA_COLLECTION fails with (Output device "" not known) error

    Hi all, I have an issue with Output BPM_DATA_COLLECTION_1 job in the satellite system  failing with 'Output device "" not known error.  Since it is collecting data for Solution Manager system why does is it trying to find an output device. It did not

  • ITunes Library Consolidation Help

    Hello there, I am new to the forum. I've been researching a little bit with little luck so I thought I'd try here. I am about to finish building a new quad core computer and would like to move my 72 gb library over to my new computer. The only thing

  • Cyrilic char not coming properly

    Hi experts, When fetching data from FTP server to application server the Cyrilic character are coming as '#'  into appl server. But ftp  data is perfect with cyrilic format. 1. how can i copied ftp cyrilic data into application server in proper cyril

  • RTMT message on low virtual memory

    I recieved message in RTMT of the CUP 8.6 Available virtual memory below configured threshold . Configured low threshold is 25 % jabberd (3021 MB) uses most of the memory. Any suggestion?