Database connection in EJB

Hi,
I am using a method for validating Userid and Password in a Session Bean. I could deploy and run it without any errors but the return value is null. The same bean If I am using with <JSP:usebean> tag the return value is correct. That means the database connection is OK. I am giving the code below.
public String validate(String UId,String PWd)throws RemoteException {
try{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:oci8:scott/tiger@Everest");
st = conn.createStatement();
String str = "select * from T_CRM_WRK_LCTN where LOGINID='"+UId+"'";
ResultSet rs = st.executeQuery(str);
while(rs.next()){
login = (String) rs.getString("LOGINID");
if(login.equals(UId)){
pass = (String) rs.getString("PASSWORD");
break;
if( (UId.equals(login)) && (PWd.equals(pass)))
flg="Y";
else
flg="N";
st.close();
conn.close();
}catch(Exception e){}
return flg;
Can anyone help me what is the problem. Thanks in advance.
Mallik
null

Hi,
Extension to the above problem, the problem is with the Connection. It is not able to establish the connection. Can anyone advise me about the possible reasons.
Mallik

Similar Messages

  • Database connection with EJB and  Sun Application Server

    I have tried some tutorials from sun in Savings account eg some errors were
    showing like primary key not found etc
    please help me to link EJB application with database application

    Debated: Primary Key requirement
    Does a GOOD database require a PK? Yes.
    Does EVERY database require a PK? Debated.
    Your db table needs a primary key. The PK is how a table identifies unique records.

  • 1 application 2 ejb 2 database connections

    Hello all.
    I have one application with 3 modules.
    1 web module with jsps, working with ADF and jsf.
    2 ejb modules, each one I need to connect to a different database.
    The problem is that the 2 ejbs are connecting to de first module's database, so the second ejb is not able to find the tables mapped to the entities.
    How can I configure this 2 ejbs to connect to one databes each?
    Thanks in advance.
    Marko.

    Hi,
    what if the JNDI lookup is done within the session bean ? As I see it, the only way out of this is to handle the different database connects and transactions manually. EJB does not provide you and option for this
    Frank

  • EJB Timer stops when database connection lost

    G'day.
    We use EJB Timers quite successfully in stateless session beans under Sun Java System Application Server 8.1 on Windows Server 2003.
    We start and stop the timers for specific session beans using public intefaces on their respective beans. This works fine.
    The problem we have is when the JDBC connection used by the EJBTimer service is dropped, such as when the remote database / machine falls over or (probably) when the network is lost. All the timers stop working at this point.
    The timers do not restart when the database connection is restored either, despite the entries still being in the ejb__timers__tbl table.
    If we stop and start the application server instance then they do restart.
    We've looked at the setup of the timers but this seems to be pretty straightforward with no options that seem to influence this.
    We've tried altering the JDBC connection validation settings but this doesn't seem to have made any difference.
    Anyone have any ideas?
    Robski!

    There are no special options to handle this case in the current timer service implementation. Please file an issue describing the scenario here :
    https://glassfish.dev.java.net/servlets/ProjectIssues
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Database connection error in Weblogic 11g

    Hello Everyone,
    I am new to this forum and Weblogic. I am in the process of migrating a big application from Weblogic 8.1 to Weblogic 11g. I am facing a issue with JDBC Commit. I am getting following exception while trying to commit
    ####<Feb 18, 2010 1:11:51 PM EST> <Debug> <JTAPropagate> <PPXP2CE951B506> <AdminServer> <ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <3de6adeed2d219bd:-1c9bd9a6:126e245ecb6:-7fff-0000000000000010> <1266516711438> <BEA-000000> <java.lang.Exception: DEBUG: receiveRequest, tx=Xid=BEA1-0000957A69A07E5F133C(16499456),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=300,XAServerResourceInfo[demoPool_cashlinkdomain]=(ServerResourceInfo[demoPool_cashlinkdomain]=(state=ended,assigned=none),xar=demoPool,re-Registered = false),SCInfo[cashlinkdomain+AdminServer]=(state=active),properties=({}),local properties=({weblogic.jdbc.jta.demoPool=[autoCommit=false,enabled=true,isXA=true,isJTS=false,vendorID=0,connUsed=true,doInit=false,'null',destroyed=false,poolname=demoPool,appname=null,moduleName=null,connectTime=187,dirtyIsolationLevel=false,initialIsolationLevel=2,infected=false,lastSuccessfulConnectionUse=1266516711423,secondsToTrustAnIdlePoolConnection=10,currentUser=java.lang.Exception
    at weblogic.jdbc.common.internal.ConnectionEnv.setup(ConnectionEnv.java:310)
    at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:344)
    at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:433)
    at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:316)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:93)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:61)
    at weblogic.jdbc.jta.DataSource.getXAConnectionFromPool(DataSource.java:1584)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1357)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:438)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:395)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:355)
    at com.mycompany.res.services.util.DatabaseHelper.getConnection(DatabaseHelper.java:109)
    at com.mycompany.res.services.util.DatabaseHelper.getConnection(DatabaseHelper.java:46)
    at com.mycompany.res.services.security.ejb.LoginManagerEJB.login(LoginManagerEJB.java:64)
    at com.mycompany.res.services.security.ejb.LoginManagerEJB_z7om1c_EOImpl.login(LoginManagerEJB_z7om1c_EOImpl.java:573)
    at com.mycompany.res.services.security.ejb.LoginManagerEJB_z7om1c_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ,currentThread=Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads],lastUser=null,currentError=null,currentErrorTimestamp=null,JDBC4Runtime=true,supportStatementPoolable=true,needRestoreClientInfo=false,defaultClientInfo={},supportIsValid=true]}),CoordinatorURL=AdminServer+10.240.15.248:7001+cashlinkdomain+t3+)
    at weblogic.transaction.internal.TxDebug.debugStack(TxDebug.java:60)
    at weblogic.transaction.internal.TransactionManagerImpl.receiveRequest(TransactionManagerImpl.java:1366)
    at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:287)
    at weblogic.rmi.cluster.ClusterableServerRef.dispatch(ClusterableServerRef.java:242)
    at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:1138)
    at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:1020)
    at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerServer.java:240)
    at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:882)
    at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:453)
    at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:322)
    at weblogic.socket.BaseAbstractMuxableSocket.dispatch(BaseAbstractMuxableSocket.java:298)
    at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105)
    at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    What is going wrong with this?
    I get the following error every time Weblogic is trying to do database connection check
    ####<Feb 18, 2010 1:35:40 PM EST> <Debug> <JTA2PC> <PPXP2CE951B506> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <BEA1-028CACE03896> <3de6adeed2d219bd:-1c9bd9a6:126e245ecb6:-7fff-00000000000000c6> <1266518140849> <BEA-000000> <BEA1-028CACE03896: JDBC Internal: TX[BEA1-028CACE03896] committing-->committed
    java.lang.Exception: DEBUG
         at weblogic.transaction.internal.TransactionImpl.setState(TransactionImpl.java:1711)
         at weblogic.transaction.internal.ServerTransactionImpl.setCommitted(ServerTransactionImpl.java:2945)
         at weblogic.transaction.internal.ServerTransactionImpl.globalRetryCommit(ServerTransactionImpl.java:2737)
         at weblogic.transaction.internal.ServerTransactionImpl.globalCommit(ServerTransactionImpl.java:2657)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:285)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:233)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:286)
         at weblogic.jdbc.common.internal.ConnectionEnv.testInternal(ConnectionEnv.java:734)
         at weblogic.jdbc.common.internal.ConnectionEnv.test(ConnectionEnv.java:704)
         at weblogic.jdbc.common.internal.ConnectionEnv.test(ConnectionEnv.java:487)
         at weblogic.common.resourcepool.ResourcePoolImpl.testResource(ResourcePoolImpl.java:2260)
         at weblogic.common.resourcepool.ResourcePoolImpl.checkResource(ResourcePoolImpl.java:1601)
         at weblogic.common.resourcepool.ResourcePoolImpl.checkAndReturnResource(ResourcePoolImpl.java:1507)
         at weblogic.common.resourcepool.ResourcePoolImpl.checkAndReturnResource(ResourcePoolImpl.java:1496)
         at weblogic.common.resourcepool.ResourcePoolImpl.testUnusedResources(ResourcePoolImpl.java:1942)
         at weblogic.common.resourcepool.ResourcePoolImpl.access$800(ResourcePoolImpl.java:40)
         at weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2368)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Edited by: user12640178 on Feb 18, 2010 10:36 AM
    Edited by: user12640178 on Feb 18, 2010 10:38 AM

    Priya,
    Thank you so much for your response. I did test my database source from console and on the console it reported the test was successful, where in the admin logs has same exception logs. I did try creating a non XA connection and it did not have these errors. But my application did raise same exception while doing transaction.
    The application has around 250 EJB's that are written long ago and they all comply to EJB 1.1 spec. I am in the process of investigating the level of support for EJB 1.1 in Weblogic 11g.
    - Kasi

  • Dynamic database connection using JNDI

    How to pass the userid and password in get the database connection in weblogic 8.1 app server?
    The following method throws exception while getting the database connection from oracle.
    DataSource.getConnection(String username,String password)
    Please advise if I need to use any other weblogic's method to get the dynamic connection. Every user of this application uses their own useid and password to connect to the database.
    Any help is appreciated.

    ANITA BERDIN wrote:
    Hi,
    I upgraded from WL8.1sp2 to sp4 and basically had to redo everything.
    But since my understanding is that all patches and fixes are already
    incorporated in this version, so I did not apply any patches. Now my
    application which was previously working is getting an error with my
    stateless session bean that I have not had before. This is the error
    I get: I wonder why I would get oracle.jdbc.driver.Accessor.isNull
    error now. Am I missing something in my install? Thanks for any help.
    at oracle.jdbc.driver.Accessor.isNull(I)ZAccessor.java:1682)
         at oracle.jdbc.driver.OracleStatement.wasNullValue()Z(OracleStatement.java:3026)
         at oracle.jdbc.driver.OracleResultSetImpl.wasNull()Z(OracleResultSetImpl.java:111)Hi. You should not have had to redo everything.... Yes, sp4 should contain
    most all of the patches you may have been running for sp2, except for any
    that you may have gotten fairly recently (found recently in sp2, but not
    fixed in time for sp4)...
    The exception above is an internal Oracle thin driver bug (it seems), so
    the difference between sp2 and sp4 may have to do with the version of Oracle's
    thin driver installed. If you want, you can try swapping out the sp4 version of
    the thin driver, and trying the one from sp2, or the latest from oracle etc.
    What is the full stacktrace of the exception? Is that it? No message?
    Joe
         at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.wasNull()Z(Unknown Source)
         at com.merial.wwppsv1.client.ejb.UserDetailListBean.getItems()Ljava.util.List;(UserDetailListBean.java:222)
         at com.merial.wwppsv1.client.ejb.UserDetailListBean_i8as44_ELOImpl.getItems()Ljava.util.List;(UserDetailListBean_i8as44_ELOImpl.java:99)
         at com.merial.wwppsv1.client.action.SearchMenu.execute(Lorg.apache.struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apache.struts.action.ActionForward;(SearchMenu.java:76)
         at org.apache.struts.action.RequestProcessor.processActionPerform(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Lorg.apache.struts.action.Action;Lorg.apache.struts.action.ActionForm;Lorg.apache.struts.action.ActionMapping;)Lorg.apache.struts.action.ActionForward;(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:1006)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet..ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava.lang.Object;(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Optimized Method)
         at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Optimized Method)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic.servlet.internal.ServletRequestImpl;Lweblogic.servlet.internal.ServletResponseImpl;)V(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.ExecuteThread;)V(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(Optimized Method)
         at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
         at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)

  • A strang problem about Resin database connection pool

    I am a beginner&#65292;hope somebody can help me.
    my web site occured a strange problem after I used the Resin database connection pool instead of
    connecting directly
    the error message as follows:java.lang.IllegalArgumentException: Request cannot be null
    at javax.servlet.ServletRequestWrapper.<init>(ServletRequestWrapper.java:100)
    at javax.servlet.http.HttpServletRequestWrapper.<init>(HttpServletRequestWrapper.java:92)
    at com.caucho.server.connection.RequestAdapter.<init>(RequestAdapter.java:96)
    at com.caucho.server.webapp.DispatchRequest.<init>(DispatchRequest.java:97)
    at com.caucho.server.webapp.IncludeDispatchRequest.<init>(IncludeDispatchRequest.java:77)
    at com.caucho.server.webapp.IncludeDispatchRequest.createDispatch(IncludeDispatchRequest.java:87)
    at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:389)
    at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:345)
    at com.caucho.jsp.PageContextImpl.include(PageContextImpl.java:807)
    at _jsp._intro__jsp._jspService(/intro.jsp:60)
    at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
    at com.caucho.jsp.Page.pageservice(Page.java:571)
    at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:155)
    at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:211)
    at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:177)
    at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
    at com.caucho.server.port.TcpConnection.run(TcpConnection.java:331)
    at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:464)
    at com.caucho.util.ThreadPool.run(ThreadPool.java:408)
    at java.lang.Thread.run(Thread.java:595)

    <!--
    - Resin 3.0 configuration file.
    -->
    <resin xmlns="http://caucho.com/ns/resin"
    xmlns:resin="http://caucho.com/ns/resin/core">
    <!--
    - Logging configuration for the JDK logging API.
    -->
    <log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/>
    <log name='com.caucho.java' level='config' path='stdout:'
    timestamp='[%H:%M:%S.%s] '/>
    <log name='com.caucho.loader' level='config' path='stdout:'
    timestamp='[%H:%M:%S.%s] '/>
    <!--
    - For production sites, change dependency-check-interval to something
    - like 600s, so it only checks for updates every 10 minutes.
    -->
    <dependency-check-interval>2s</dependency-check-interval>
    <!--
    - You can change the compiler to "javac" or jikes.
    - The default is "internal" only because it's the most
    - likely to be available.
    -->
    <javac compiler="internal" args=""/>
    <!-- Security providers.
    - <security-provider>
    - com.sun.net.ssl.internal.ssl.Provider
    - </security-provider>
    -->
    <!--
    - If starting bin/resin as root on Unix, specify the user name
    - and group name for the web server user.
    - <user-name>resin</user-name>
    - <group-name>resin</group-name>
    -->
    <!--
    - Configures threads shared among all HTTP and SRUN ports.
    -->
    <thread-pool>
    <!-- Maximum number of threads. -->
    <thread-max>128</thread-max>
    <!-- Minimum number of spare connection threads. -->
    <spare-thread-min>25</spare-thread-min>
    </thread-pool>
    <!--
    - Configures the minimum free memory allowed before Resin
    - will force a restart.
    -->
    <min-free-memory>1M</min-free-memory>
    <server>
    <!-- adds all .jar files under the resin/lib directory -->
    <class-loader>
    <tree-loader path="$resin-home/lib"/>
    </class-loader>
    <!-- Configures the keepalive -->
    <keepalive-max>500</keepalive-max>
    <keepalive-timeout>120s</keepalive-timeout>
    <!-- The http port -->
    <http server-id="" host="*" port="8080"/>
    <!--
    - SSL port configuration:
    - <http port="8443">
    - <openssl>
    - <certificate-file>keys/gryffindor.crt</certificate-file>
    - <certificate-key-file>keys/gryffindor.key</certificate-key-file>
    - <password>test123</password>
    - </openssl>
    - </http>
    -->
    <!--
    - The local cluster, used for load balancing and distributed
    - backup.
    -->
    <cluster>
    <srun server-id="" host="127.0.0.1" port="6802" index="1"/>
    </cluster>
    <!--
    - Enables/disables exceptions when the browser closes a connection.
    -->
    <ignore-client-disconnect>true</ignore-client-disconnect>
    <!--
    - Enables the cache
    -->
    <cache path="cache" memory-size="10M"/>
    <!--
    - Enables periodic checking of the server status.
    - With JDK 1.5, this will ask the JDK to check for deadlocks.
    - All servers can add <url>s to be checked.
    -->
    <ping>
    <!-- <url>http://localhost:8080/test-ping.jsp</url> -->
    </ping>
    <!--
    - Defaults applied to each web-app.
    -->
    <web-app-default>
    <!--
    - Sets timeout values for cacheable pages, e.g. static pages.
    -->
    <cache-mapping url-pattern="/" expires="5s"/>
    <cache-mapping url-pattern="*.gif" expires="60s"/>
    <cache-mapping url-pattern="*.jpg" expires="60s"/>
    <!--
    - Servlet to use for directory display.
    -->
    <servlet servlet-name="directory"
    servlet-class="com.caucho.servlets.DirectoryServlet"/>
    </web-app-default>
    <!--DataSource jndi configuration-->
    <database>
    <jndi-name>jdbc/artunion</jndi-name>
    <driver type="org.gjt.mm.mysql.Driver">
    <url>jdbc:mysql://localhost:3306/union</url>
    <user>as</user>
    <password>as</password>
    </driver>
    <prepared-statement-cache-size>8</prepared-statement-cache-size>
    <max-connections>20</max-connections>
    <max-idle-time>30s</max-idle-time>
    </database>
    <!--
    - Default host configuration applied to all virtual hosts.
    -->
    <host-default>
    <class-loader>
    <compiling-loader path='webapps/WEB-INF/classes'/>
    <library-loader path='webapps/WEB-INF/lib'/>
    </class-loader>
    <!--
    - With another web server, like Apache, this can be commented out
    - because the web server will log this information.
    -->
    <access-log path='logs/access.log'
    format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
    rollover-period='1W'/>
    <!-- creates the webapps directory for .war expansion -->
    <web-app-deploy path='webapps'/>
    <!-- creates the deploy directory for .ear expansion -->
    <ear-deploy path='deploy'>
    <ear-default>
    <!-- Configure this for the ejb server
    - <ejb-server>
    - <config-directory>WEB-INF</config-directory>
    - <data-source>jdbc/test</data-source>
    - </ejb-server>
    -->
    </ear-default>
    </ear-deploy>
    <!-- creates the deploy directory for .rar expansion -->
    <resource-deploy path='deploy'/>
    <!-- creates a second deploy directory for .war expansion -->
    <web-app-deploy path='deploy'/>
    </host-default>
    <!-- includes the web-app-default for default web-app behavior -->
    <resin:import path="${resinHome}/conf/app-default.xml"/>
    <!-- configures the default host, matching any host name -->
    <host id=''>
    <document-directory>D:/artunion</document-directory>
    <!-- configures the root web-app -->
    <web-app id='/'>
    <!-- adds xsl to the search path -->
    <class-loader>
    <simple-loader path="$host-root/xsl"/>
    </class-loader>
    <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
    </web-app>
    </host>
    </server>
    </resin>
    Thank you!

  • 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

  • Stale Database Connections in Production Environment - Oracle 9.0.4.1

    Every so often we encounter stale database connections in our connection pools. To us, this should not happen, as the connections should be refreshed, if idle, every so often.
    Please see the data-sources entry below for an example connection pool. They are all pretty much the same. We have a retry-interval and inactivity-timeout specified!
    Are we missing something obvious.. Any help at all on this would be much appreciated as this is an ongoing issue in a real-time CRM type application currently running in Production.
    Cheers in advance.
    data-source class="oracle.jdbc.pool.OracleConnectionCacheImpl" location="jdbc/COMMONCoreDS" password="" min-connections="10" username="" url="" xa-location="jdbc/xa/COMMONXADS" inactivity-timeout="60" connection-driver="oracle.jdbc.driver.OracleDriver" wait-timeout="10" max-connect-attempts="3" max-connections="45" name="COMMONDS" ejb-location="jdbc/COMMONDS" connection-retry-interval="30" stmt-cache-size="200">
              <description>Oracle DataSource to Common Schema</description>
         </data-source>

    public Connection borrowConnection() throws SQLException
    logger.debug("borrowConnection");
    Connection conn = null;
    try
    conn = mDatasource.getConnection();
    conn.setAutoCommit(false);
    if (conn==null)
    logger.fatal("Borrow connection failed");
    throw new SQLException();
    catch(SQLException e)
    logger.fatal("Borrow connection failed",e);
    throw e;
    return conn;
    public static void releaseConnection(Connection conn)
    logger.debug("releaseConnection");
    try
    if (conn!=null)
    conn.close();
    catch(SQLException e)
    logger.warn(e);

  • Jdbc connection in EJB using wsad 5.0

    Hi,
    I want to develop a small application using Ejbs by using oracle 9i as D/b, wsad 5.0 as app server . The problem is i am not able to connect to oracle database in WSAD. What i am doing is i have installed Oracle 9i in my system and has given the Global database name as "samp" while installation . I open my SQL plus with username scott and password tiger and i am able to do all my sql queries successfully.
    Now coming to WSAD,
    while creating a JDBC connection using Oracle 9i driver,
    i ve opened in Data perspective and in that go to DB Servers -> Right click -> New Connection
    There a window is opened for Database Connection.
    We need to fill the fields there.
    I have given samp as Global d/b name while installing Oracle 9i .
    In the window , the feilds are
    Connection Name : conn
    Database Name : samp
    user id : scott
    password : tiger
    D/b vendor type: Oracle 9i
    Jdbc Driver : Oracle Thin Driver
    Host : 127.0.0.1
    port No: 1521
    class location : c:\oracle\ora90\jdbc\lib\classes12.zip
    connection url : jdbc:oracle:thin:@127.0.0.1:1521:samp
    the class location and connection url are automatically coming.
    and please check whether all fields are correct or not
    Is this the correct way.
    Next in code if i want to connect to database should i use connection establish commands again or i can directly use create statement or prepare statement.
    Please reply.
    Thanks

    Create New Server and configure it properly
    It will work
    procedure is as follows:
    Pls visit the following link:
    http://www.webagesolutions.com/knowledgebase/waskb/waskb001/index.html
    Adding a Oracle9i DataSource from WSAD5
    Bibhas Bhattacharya, Web Age Solutions Inc.
    Before you begin, make sure that you have Oracle installed and a database is created. In this document we will use a database called MALL.
    Create a WAS V5 Server
    If you don't already have a WebSphere V5 server created, do so following these steps. Switch to the Server perspective. Right click in the Server Configuration view and select New->Server and Server Configuration.
    Name the server WASV5. Make sure that the Server type is set to WebSphere version 5.0->Test Environment. Click on Finish.
    Add the Database User
    In WSAD5, the default user ID and password to be used by a DataSource are first entered as a JAAS authentication entry.
    In the Server Configuration view, double click on WASV5 to open the configuration editor. Click on the Security tab. Next to the JAAS Authentication Entries list click on Add and add the user.
    Add the JDBC Driver
    Still in the server configuration GUI click on the DataSource tab. You can add the DataSource at the server level or at the node level. We will add it at the server level. Make sure that the Server Settings is expanded. Next to the JDBC providers list click on Add.
    Select the following options:
    Database type: Oracle
    JDBC provider type: Oracle JDBC Thin Driver or the XA version of it if you need two phase commit transaction.
    Click on Next.
    Set the name to Oracle Thin Driver.
    Notice that the location of the driver's class is automatically set to ${ORACLE_JDBC_DRIVER_PATH}/classes12.zip. Here, ORACLE_JDBC_DRIVER_PATH is a node level variable. We need to make sure that the variable is pointing to the correct directory where Oracle's JDBC driver is installed. In our case, we had installed Oracle in c:\oracle. This had installed the JDBC driver class in C:/oracle/ora81/jdbc/lib/classes12.zip.
    In the server configuration GUI click on the Variables tab. Under the Node settings select ORACLE_JDBC_DRIVER_PATH from the Defined variables list. Click on Edit and set the value to C:/oracle/ora81/jdbc/lib.
    Add the DataSource
    Click on the DataSource tab again. Select the Oracle Thin Driver you had created in the previous step. Click on Add next to the Data source defined in the JDBC provider selected above list.
    Select the following options:
    Select the type of JDBC Driver: Oracle JDBC Thin Driver.
    Select the data source type: Unless you will be testing your application with WAS V4, select Version 5.0. You can not use a V4 DataSource from a J2EE 1.3 EJB module running in WebSphere V5.
    Click on Next.
    Enter these key attributes in this screen:
    Name: My Oracle DataSource
    JNDI Name: jdbc/MyDataSource
    DataSource helper class name: com.ibm.websphere.rsadapter.OracleDataStoreHelper. Should be selected by default. The helper class is needed if you wish to access IBM extensions to JDBC. For more details search in WSAD help for "WSDataSource interface".
    Component-managed authentication alias: Set this if you wish to lookup the DataSource using its global JNDI name or using the java:comp/env/ name space and have set the authentication type of the resource reference to Application. Select the JAAS entry you had created. That is, Database user.
    Container-managed authentication alias: Set this if you intend to lookup the DataSource using the java:comp/env/ name space and have set the authentication type of the resource reference to Container. Select the JAAS entry you had created. That is, Database user.
    Use this data source in container managed persistence (CMP): Check on if you intend to use the DataSource from CMP EJBs.
    Click on Next.
    You need to set these properties:
    databaseName: MALL in our case.
    URL: jdbc:oracle:thin:@noble.webagesolutions.com:1521:MALL. In my case the server host name is noble.webagesolutions.com. The listener port number is 1521 (usually the default in most Oracle installations).
    Click on Finish.
    You have finished adding the DataSource. Save the server settings by clicking Control+S. Close the server configuration GUI.
    Testing the DataSource
    There is no out of the box way to test the DataSource. You can create a simple Servlet and add the following code:
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    javax.sql.DataSource ds = null;
    java.sql.Connection con = null;
    java.io.PrintWriter out = resp.getWriter();
    resp.setContentType("text/html");
    try {
    out.println("Looking up DataSource<br>");
    javax.naming.InitialContext ctx = new javax.naming.InitialContext();
    ds = (javax.sql.DataSource) ctx.lookup("jdbc/MyDataSource");
    out.println("Getting connection<br>");
    con = ds.getConnection();
    con.close();
    } catch (Exception e) {
    e.printStackTrace(out);
    out.println("Done<br>");
    Feedback
    Your e-mail:
    Rate this article:
    Very useful Somewhat useful Not bad Needs many corrections
    Comments:

  • 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 ;-)

  • Database connection error on launch of OC4j

    (jdk1.5.0_05/jdeveloper 10.1.3..0.3.3412)
    I have a working database connection in the Connection Navigator, but when I try to run my app in OC4j I get:
    06/01/09 14:06:32 Error instantiating application 'current-workspace-app' at file:/C:/local/jdevstudiobase1013/jdev/mywork/office2/office2-oc4j-app.xml: Error initializing ejb-modules:
    Internal Exception: java.sql.SQLException: Io exception: The Network Adapter could not establish the connectionError Code: 17002
    I'm very new to all this, but I don't think this is something very silly I've omitted.
    Thanks in advance.

    Is the JDBC connection with the Oracle dataabse?
    The Network Adapter exception is caused because:
    1.     The database host name, port number, or database instance name is wrong.
    2.     The database TNSListener has not been started. The TNSListener may be started with the lsnrctl utility.
    C:\>lsnrctl start

  • 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.
    %

  • Oc4j and database connections issue (way too many created)

    I seem to be experiencing a serious issue every time someone connects to my application. New connections are made to the database instead of using existing connections (i.e. pooling doesn't seem to work). In my data-sources.xml, the pools are set to have a max-connections of 3, yet when I query the v$sessions view, there are additional sessions created every time the application is hit which has sent it way over the max-connections parameter in the data-sources.xml file. If oc4j is pooling the connections how can this happen? Is there any way of tracking where this is occurring or what could be causing this? (SQLNET.EXPIRE_TIME has been set, database is 10g, oc4j is 101202 and oc4j on linux platform)
    Thanks
    Paul

    Paul,
    According to the documentation for OC4J 10.1.2, if you use the value of the "ejb-location" attribute (from the "data-sources.xml" file) when doing a JNDI lookup of your datasource, then you should be using connection pooling.
    It's probably also an idea to not define a "pooled-location" attribute in your "data-sources.xml" file.
    Also, you can get database connection information via the "Spy" [Web] application. Use the following URL:
    http://oc4jHost:oc4jPort/dmsoc4j/Spy
    Of-course you need to replace "oc4jHost" and "oc4jPort" with the appropriate values. For example if you open your Web browser on the same machine that OC4J is running on, and if you are using the default port, then the URL will be:
    http://localhost:8888/dmsoc4j/Spy
    Good Luck,
    Avi.

  • (IMP)Application module and database connection

    Hi,
    How application module pooling and database connection pooling is working ?
    Currently i m facing a problem like if i am creating 10 browser session then it doesn't mean that i'll have only 10 db sessions. While closing the browser session of application module time out respective db session is not removed.
    In this case, invalid db session are created in bulk which is crashing database sometime. We have writter script to kill those session periodically but in this case if application module is accessing such dbconnection then we are getting session killed error or not logged in error.
    To over come we need to bounce the server (middle tier).
    Is there any proper way to solve this or am i doing something wrong ?
    Please let me know if you need any more details.
    Thanks in advance
    Devang

    Thanks for your prompt reply Ricky.
    I just found out that in some of the JSP pages in application
    <jbo:ReleasePageResources/> is not written. Should this problem arise because of this?
    could you please tell me how can I release page resources in UIX pages ?
    Datasources.xml file content
    <data-source class="com.evermind.sql.DriverManagerDataSource"
    name="AITDS"
    location="jdbc/AITCoreDS"
    pooled-location="jdbc/pooled/AITPDS"
    xa-location="jdbc/xa/AITXADS"
    ejb-location="jdbc/AITDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username=<USERNAME>
    password=<PASSWORD>
    url=<URL>
    inactivity-timeout="30"
    />
    bc4j.xcfg file
    <BC4JConfig>
    <AppModuleConfigBag>
    <AppModuleConfig name="GsaServerModuleLocal">
    <DeployPlatform>LOCAL</DeployPlatform>
    <JDBCDataSource>jdbc/AITCoreDS</JDBCDataSource>
    <jbo.project>gsa</jbo.project>
    <AppModuleJndiName>oracle.appsit.gsa.server.GsaServerModule</AppModuleJndiName>
    <java.naming.factory.initial>oracle.jbo.common.JboInitialContextFactory</java.naming.factory.initial>
    <ApplicationName>oracle.appsit.gsa.server.GsaServerModule</ApplicationName>
    </AppModuleConfig>
    </AppModuleConfigBag>
    </BC4JConfig>
    Let me know if you need any more detail.
    Thanks in advance
    Devang

Maybe you are looking for

  • Oracle DB Polling Proxy not polling for records concurrently

    Problem Description We have created a Polling Proxy on OSB from a DB Adapter with the below JCA parameters • PollingStrategy = "LogicalDeletePollingStrategy" • MarkReadColumn = "STATUS" • MarkReadValue = "S" • MarkReservedValue = "R${weblogic.Name-2}

  • Create a portlet by using Sun One Studio 5

    Hi, I am having Sun One Studio 5 and Portlet Builder 2.0, however I do not know how to create a portlet and deploy it into war. Please help me create a portlet using Sun One Studio 5. Thanks in advance. [email protected]

  • Export backup failing with ORA-1555snapshot too old: rollback segment ERROR

    DB version =8.1.7.4 OS=Solaris =5.10. I know this is outdated. But still we are supporting this version of database. We are facing ORA-1555 error daily when we are running the export backup of database. Consistent parameter is set to N . I needed to

  • Employee Performance Management

    Hello, we are running an own written performance management solution based on Netweaver Sp18, ERP SP15 with Enhancement Package 3. We are now looking for redesigning our performance management solution because it looks a little bit "old". Alternative

  • How do i make a song into a ringtone

    how do i make a itune song into a ringtone