Avoiding stale JDBC connections
Hi,
I find the following error frustrating...
ORA-04068: existing state of packages has been discarded
...but am willing to accept that this happens because I am mis-using the JDBC driver somehow. I don't fully understand why this behaviour is better than having the connection just use the new package state.
Our app uses dbcp for connection pooling and I don't feel comfortable with the fact that I have to restart (or notify) it that all of its connections are now likely to be broken if I change the spec of a package.
Thanks.
Hi. This is a consequence of DBMS policies. The client should not have
to close it's connection(s), but should be able to close it's currently open
prepared/callable statements and remake them.
WebLogic is able to do that, and maybe your middleware can too, but
if not, it's not a driver issue or anything the driver can handle automatically.
The DBMS can invalidate the query plan at any time. It might be a DBMS
enhancement request to have an option where existing clients remain
old query plan (if possible), but that would be a difficult thing to implement.
The DBMS would have to be able to interpret whether any give change in
the DBMS schema would hurt the semantics and/or construction of all
existing compiled query plans, and I bet those compiled query plans don't
keep enough metadata to determine that. It would take a virtual recompile
in any case to be sure.
Joe Weinstein at BEA Systems
Similar Messages
-
Infinite loop - A stale JDBC connection was detected in the connection pool
Hello.
I have a simple JSP (no servlets) application with a single Fastlane Reader style view object to back it up. I'm deploying my application under OC4J 10g 9.0.4 using BC4J 9.0.3.11.50 (JDev 9.0.3.3) on RHEL 3.0, j2sdk1.4.2_03.
I run with -Djbo.debugoutput=console
Every so often, intermittently, and totally unpredictably, I see this on stdout for OC4J:
03/12/23 07:42:07 [33326] A stale JDBC connection was detected in the connection pool
03/12/23 07:42:07 [33327] Creating a new pool resource
03/12/23 07:42:07 [33328] Trying connection/2: url='jdbc:oracle:thin:@somedb:1521:somedbsid' info='{user=someuser, password=somepass, dll=ocijdbc9, protocol=thin}' ...
This message occurs over and over ultimately resulting in hundreds upon thousands of failed connections to the database. I have to forcibly restart OC4J to stop it.
The weird thing about it is that it seems to only start doing this on one system (which is our internal deployment site); it works fine under an OC4J running in IDE or on a preproduction machine.
Has anyone experienced this before - or at the very least, can clue me in on getting BC4J to be a little more verbose on the connection failure?
Thanks and Happy Holidays,
SeanHi did you find an answer?
if so, could you post it here?
thanks -
I have successfully added an ExceptionHandler to Toplink which does catch stale JDBC connections and refreshes them.
However, once in while this does not work and I see this in the logs:
2004-09-07 13:14:52 StandardWrapperValve[action]: Servlet.service() for servlet
action threw exception
java.lang.NullPointerException
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reestablishCo
nnection(DatabaseAccessor.java:1326)
at us.fed.fs.toplink.ExceptionHandler.handleException(ExceptionHandler.j
ava:71)
at oracle.toplink.publicinterface.Session.handleException(Session.java:1
824)
at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeS
et(UnitOfWork.java:1108)
at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(UnitOf
Work.java:927)
at oracle.toplink.publicinterface.UnitOfWork.commitAndResume(UnitOfWork.
java:784)
I suppose I could add another exception trap in the ExceptionHandler to retry the re-establish connection call, but I am afraid this would set up a never endling loop.
Does anyone have insight on why reestablish connection sometimes fails? Is there an established procedure to deal with it?
Thanks,
BradHi. This is a consequence of DBMS policies. The client should not have
to close it's connection(s), but should be able to close it's currently open
prepared/callable statements and remake them.
WebLogic is able to do that, and maybe your middleware can too, but
if not, it's not a driver issue or anything the driver can handle automatically.
The DBMS can invalidate the query plan at any time. It might be a DBMS
enhancement request to have an option where existing clients remain
old query plan (if possible), but that would be a difficult thing to implement.
The DBMS would have to be able to interpret whether any give change in
the DBMS schema would hurt the semantics and/or construction of all
existing compiled query plans, and I bet those compiled query plans don't
keep enough metadata to determine that. It would take a virtual recompile
in any case to be sure.
Joe Weinstein at BEA Systems -
We have a web application that is currently depending on Application Module Pooling.
Our production system is configured with PIIX to enforce a multiple DMZ model. The ocj4 instance serving our application is in one DMZ and the data base server is in another. PIIX is configured to disable connections between firewalls that are idle for 30 minutes. Over time, JDBC connections leak (50 to 60 a day). It looks like when the fire wall disables a connection that is being referenced by an application module that has been idle for 30 minute, that application module is getting a new connection to service without returning the disabled connection to the OS.
Would we set the jbo.maxpoolcookieage property of the Application Module to less than 30 minutes to avoid the JDBC connection leaks? If not, how can we configure the application module so that disabled JDBC connections are returned to the operating system if the connection has been timeout out by the firewall software?
Thanks in advance.My thought is that your firewall feature is completely
at odds with connection pooling.
Doesn't it stand to reason that a conn will be idle when
your app is idle?
On the other hand, you might be able to use J2EE (OC4J)
conn pooling and tune the closing the idle connection in
data-sources.xml and set min conns to zero. This way
you might get the container to close all conns and you'll
leak no idle conns.
I don't think AM pooling with nailed up conns or using
BC4J's conn pooling will time out idle conns as will
the J2EE container.
Search this forum on data-source.xml and I posted definative
how-to configure datasource connection configuration and
tuning.
BTW, doing this, will make first users of your app sluggish
as they pay the cost of new connections. ;-(
Good luck.
curt -
How to use JDBC Connection Pools in a standalone application?
Hi, there,
I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
any hint will be great apprieciated!
SamTo my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.
-
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); -
Error while creating a report that uses Oracle OCI JDBC connectivity
Please let me know why my CR and LF characters are removed from my forum posting *****
Hi,
I was trying to create a report that uses Oracle OCI JDBC connectivity. I am using Eclipse3.4 download from "cr4e-all-in-one-win_2.0.2.zip". I have successfully created a JDBC OCI connection.
The connection parameters are given below:
URL: jdbc:oracle:oci8:@xe
Database: xe
username: <userName>
password: <password>
I have tested the above connection in Data source Explorer and it works fine!!!
But I am getting the following error when I drag-and-drop a table from the list of tables. Not sure what I am missing here? Any help is highly appreciated.
com.businessobjects.reports.jdbinterface.common.DBException: InvalidURLOrClassName
at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source)
at com.crystaldecisions.reports.queryengine.JDBConnectionWrapper.Open(SourceFile:123)
at com.crystaldecisions.reports.queryengine.Connection.br(SourceFile:1771)
at com.crystaldecisions.reports.queryengine.Connection.bs(SourceFile:491)
at com.crystaldecisions.reports.queryengine.Connection.t1(SourceFile:2979)
at com.crystaldecisions.reports.queryengine.Table.u7(SourceFile:2408)
at com.crystaldecisions.reports.dataengine.datafoundation.AddDatabaseTableCommand.new(SourceFile:529)
at com.crystaldecisions.reports.common.CommandManager.a(SourceFile:71)
at com.crystaldecisions.reports.common.Document.a(SourceFile:203)
at com.businessobjects.reports.sdk.requesthandler.f.a(SourceFile:175)
at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(SourceFile:1079)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1163)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:657)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:163)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:525)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:523)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$3.doWork(ExecutorWithIdleProcessing.java:182)
at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityTask.run(PriorityTask.java:75)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.runSubtask(PriorityCompoundCancellableRunnable.java:187)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityProgressAwareRunnable.runSubtask(PriorityProgressAwareRunnable.java:90)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.doWork(PriorityCompoundCancellableRunnable.java:144)
at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$IdleTask.run(ExecutorWithIdleProcessing.java:320)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Thanks
Karthik
Edited by: KARTHIK1 on Oct 14, 2009 9:38 PMHi Ted,
Thanks for the feedback. I was able to create a report in Creystal Reports Designer 2008 using OCI. It is not allowing only in the Eclipse plugin. In our environment we are not allowed to user Oracle thin connections and ONLY OCI is allowed.
1) Can you please let me know if there is a way to do this?
2) Will it allow data sources using native database driver?
3) If so, can I use JRC to create these reports from a desktop java program?
Thanks & Regards
Karthik
Edited by: KARTHIK1 on Oct 15, 2009 4:38 PM -
Issue JDBC connection pool with Glassfish 3.1.2.2 and Oracle XE 11gR2
Hello,
I am experiencing an issue with pinging a JDBC connection Pool.
I installed the following without any warnings or errors:
Operating System: Oracle Enterprise Linux 5
Oracle XE 11gR2 (11.2.0.2.0) database
Glassfish 3.1.2.2
I will refer to the steps I did after the installations
1) In the .profile file of the OS I add the following:
JRE_HOME=/usr/java/jre1.6.0_31; export JRE_HOME
JAVA_HOME=/usr/java/jdk1.6.0_31; export JAVA_HOME
GLASSFISH_DIR=/u01/glassfish3
GLASSFISH_HOME=/u01/glassfish3/glassfish
DERBY_HOME=$GLASSFISH_DIR/javadb
OPEN_MQ_HOME=$GLASSFISH_DIR/mq
PATH=:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH:$HOME/bin:$GLASSFISH_HOME/bin:$DERBY_HOME/bin:$OPEN_MQ_HOME/bin
export GLASSFISH_HOME
export DERBY_HOME
export OPEN_MQ_HOME
export PATH
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib; export LD_LIBRARY_PATH
. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
2) I copied the ojdbc6.jar to the $GLASSFISH_HOME/domains/domain1/lib
3) I login to the Glassfish admin console and created a new JDBC Connection Pool.
Pool Name: ds_orasys
Resource Type: javax.sql.DataSource
Datasource Classname: oracle.jdbc.pool.OracleDataSource
User: [myschema]
Password: [myschema password]
URL: jdbc:oracle:thin:@localhost:1521:xe
When I ping the connection pool I get the following message in the server log:
[#|2012-10-23T12:14:37.069+0300|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service|_ThreadID=22;_ThreadName=Thread-2;|RAR8054: Exception while creating an unpooled [test] connection for pool [ ds_orasys ], Connection could not be allocated because: Invalid Oracle URL specified|#]
[#|2012-10-23T12:14:37.071+0300|SEVERE|glassfish3.1.2|org.glassfish.admingui|_ThreadID=19;_ThreadName=Thread-2;|RestResponse.getResponse() gives FAILURE. endpoint = 'http://212.205.62.217:4848/management/domain/resources/ping-connection-pool.json'; attrs = '{id=ds_orasys}'|#]
I tried to use different jar files. I used ojdbc6dms.jar and ojdbc14.jar.
I also copied the jar files in the $GLASSFISH_HOME/domains/domain1/lib/ext directory as some people suggested. Still no luck. I keep getting the same error messages in the server.log
Can anybody help me out or point me to the right direction.
Thank you in advanceThe error is in the URL. It was in front of my eyes and I couldn't see the error. I skipped the ':' before the '@' when I created the pool. It is working fine now.
-
JDBC Connection pool recovery after DB server restart
I am finding that Kodo is throwing the following exception after I restart
my database server (mysql). I am doing the database server restart while my
application server is idle, so it is not during a transaction.
Communication link failure: java.net.SocketException [code=0;state=08S01]
NestedThrowables:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
This is presumably due to the JDBC connection pooling. Is there a
configuration setting that allows Kodo to detect such failures and reconnect
to the database server without exposing this problem to the application
code? For example, WebLogic Server's JDBC connection pool has a setting that
enables testing a connection and recovering from such failures before
allocating it from the pool.
BenThis is presumably due to the JDBC connection pooling. Is there a
configuration setting that allows Kodo to detect such failures and reconnect
to the database server without exposing this problem to the application
code?Not right now. You can log an enhancement request with our bug database:
http://bugzilla.solarmetric.com/ -
JDBC connection pool failures when used by JMS stores
We are using WebLogic 6.1 sp2. We defined a separate connection pool for use by
a JMS Store.
<JDBCConnectionPool Name="sybaseJMSPool"
Targets="cluster00"
InitialCapacity="2"
MaxCapacity="10"
DriverName="com.sybase.jdbc2.jdbc.SybDriver"
Properties="[email protected]@;[email protected]@;charset=utf8"
URL="jdbc:sybase:Tds:@jms.db.host@/@jms.db.name@"/>
(note that the @xxx@ string are replaced by actual values).
We are using Sybase Jconnect 5.5 to a Sybase ASE 12.5 database.
We deployed this configuration on a number of environments (testing, staging,
..). The actual hardware and network configuration is different for the different
system, but the WebLogic domain stays the same regarding this issue.
On the test system we frequently get the following exceptions:
<Aug 13, 2002 1:56:04 PM CEST> <Alert> <JMS> <www00-test> <node00>
<ExecuteThread: '6' for queue: 'JMS.TimerClientPool'> <> <> <040048>
<JMSServer "JMSServer00", store failure while writing message for topic
OrderChangeTopic, java.io.IOException: JMS JDBC store, connection pool =
<sybaseJMSPool>, prefix = <JMS00>: write failed
java.sql.SQLException: JZ006: Caught IOException:
com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
closed.
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
(ErrorMessage.java:715)
at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
(SybStatement.java:1625)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
(SybPreparedStatement.java:91)
at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
(P6LogPreparedStatement.java:179)
at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
.>
java.io.IOException: JMS JDBC store, connection pool = <sybaseJMSPool>, prefix
= <JMS00>: write failed
java.sql.SQLException: JZ006: Caught IOException:
com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
closed.
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
(ErrorMessage.java:715)
at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
(SybStatement.java:1625)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
(SybPreparedStatement.java:91)
at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
(P6LogPreparedStatement.java:179)
at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
at weblogic.jms.store.JDBCIOStream.throwIOException
(JDBCIOStream.java:1213)
at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1256)
at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Before that this message appeared:
<Aug 13, 2002 11:31:16 AM CEST> <Error> <ConnectionManager> <www00-test>
<node00> <ExecuteThread: '26' for queue: 'default'> <> <> <000000>
<Closing: 'weblogic.rjvm.t3.T3JVMConnection@795af6' because of: 'Server
received a message over an uninitialized connection: 'JVMMessage from: 'null'
to: '-4555218188801970213S:192.168.13.1:[7001,7001,7002,7002,7001,7002,-
1]:ADIS:node00' cmd: 'CMD_REQUEST', QOS: '101', responseId: '1',
invokableId: '287', flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev
offset: '34'''>
This problem did not occur on another system which was used during a 2 day stress
testing session.
It seems that the problem occurs after a period in which no user request where
made. The user requests trigger EJB's that start sending JMS messages.
When the problem occurs, the JMS messaging systems seems to lock up as no messages
are received anymore by the different listeners (MDBs).
Undeploying and redeploying the JBDC connection pool solves the problem. This
solution is unacceptable in case of a production system.
A similarly defined connection pool, which is used by the EJBs to make database
connection, does not manifest this problem.
<JDBCConnectionPool Name="sybasePool"
Targets="cluster00"
InitialCapacity="10"
CapacityIncrement="5"
MaxCapacity="50"
PreparedStatementCacheSize="150"
DriverName="com.sybase.jdbc2.jdbc.SybDriver"
Properties="[email protected]@;[email protected]@;JCONNECT_VERSION=6;charset=utf8"
URL="jdbc:sybase:Tds:@db.host@/@db.name@"/>
The JDBC connection pool is used as follows by the JDBC store
<JMSJDBCStore ConnectionPool="sybaseJMSPool" Name="JDBCStore00" PrefixName="JMS00"/>
<JMSServer Name="JMSServer00" Store="JDBCStore00" Targets="node00">
<JMSTopic JNDIName="ADIS.JMSError" JNDINameReplicated="false" Name="ErrorTopic"/>
<JMSTopic JNDIName="ADIS.Status"
Name="StatusTopic" RedeliveryDelayOverride="300000"/>
<JMSTopic JNDIName="ADIS.OrderChange" JNDINameReplicated="false"
Name="OrderChangeTopic" RedeliveryLimit="3"/>
</JMSServer>
Turning on the "Test Reserved Connection" with a appropriate test table does not
help.
Some sources on the internet tell us that JZ0C0 errors in the Jconnect driver
can be related to network problems. Nevertheless the connection pool should be
able to cope with this.
Can you provide any solution for this ? Or give us hints what can cause the problem
Zhenhao Qi wrote:
thanks! Joe.
The SQL statement itself can no longer be simplified, the long excuation time is due to the database size and complicated Select criteria. I can easily reproduce the problem by using this SQL. I tried "BEA's Oracle driver (Type 4): Version 8.1.7,9.0.1,9.2.0". the question can be dissect into 2 pieces:
1) why the jdbc connection (using oracle.jdbc.OracleDriver) won't return anything if the SQL execution time > 5min, that is probably the Oracle's problem
2) why the occupied connection pool won't release even I set "Statementtimeout=600", this is Weblogic's problem.
ZhenhaoHi. Yes, (1) is oracle's problem. (2) may also be. The JDBC spec has very few
allowances for one thread to interrupt a second thread's JDBC call. If we
transmit your timeout request by calling setQueryTimeout() on the oracle
statement, and if you have a weblogic-controlled transaction we call
Statement.cancel() on any ongoing statement, we end up relying on whether
the Oracle driver implements and responds to those calls.
Are you doing weblogic-controlled transactions? Are you/can you
call Statement.setQueryTimeout() on your statements, or are these
generated JDBC queries?
If you can duplicate the problem using the weblogic.jdbc.oracle.OracleDriver
we have some other debug avenues. This would be good even if you really
want to use the thin driver, because we will do the same JDBC calls to
either driver, and the debug would prove (if) we set up a query timeout
and if we call cancel(). If we do, then we can know that it is the Oracle
driver failing in these regards.
Joe -
JDBC Connection pools and clusters (is max connection for entire cluster?)
Hi,
Quick question.
When using JDBC connection pools in WAS 6.40 (SP13) in a clustered environment. Are the max connections the number
a)Each application server can use
b)The entire cluster can use
Would believe a), but I'd like it confirmed from someoneelseHi Dagfinn,
your assumption is correct. Therefore, in a cluster environment you'd need to make sure the DB can open <i>Number of nodes X max connections</i>. -
Issues with JDBC Connection Pooling
Hi all,
I'm experiencing some unexpected behaviour when trying to use JDBC Connection Pooling with my BC4J applications.
The configuraiton is -
Web Application using BC4J in local mode
Using Default Connection Stagegy
Stateless Release Mode
Retrieving Application Modules using Configuration.createRootApplicationModule( am , cf );
Returning Application Modules using Configuration.releaseRootApplicationModule( am, false );
Three application modules
AppModuleA - connects to DatabaseConnection1
AppModuleB - connects to DatabaseConnection2
AppModuleC - connects to DatabaseConnection2
My requirement is to -
Use App Module Pooling and have individual pool for each Application Module
Use JDBC Pooling and have individual pool for each Database connection
Note: All configuration was achieved in design mode (i.e. right clicking AppModule->Configurations...)
1. Initial approach -
In the configuration for each Application Module I specified the connection type as 'JDBC Datasource' and specified to approriate datasource.
Tried setting doConnecitonPooling to 'true' as well as 'false'
In the data-sources.xml I specified all the appropriate info including min-connections and max-connections.
I would expect, with the above config that BC4J would use OC4J's built in JDBC connection pooling.
2. Second approach -
In the configuration for each Application Module I specified the connection type as JDBC URL.
In the configuration I specified doConnectionPooling = 'true' as well as the max connection, max available and min available
What I experienced in both cases was that the max connections seem to be ignored as the number of connection as reported by the database (v$session) was exceeded by more than 10.
In addition to this once the load was removed the number of JDBC connecitons did not drop (I would have expected it to drop to max available connections)
My questions are -
1. When specifying to use a 'JDBC Datasource' style of connection, is it in fact OC4J that is then responsible for pooling JDBC connections? And in this case should BC4J's doConnectionPooling parameter be set to true or false?
2. Are there any known issues with the use of the JDBC Conneciton Pool as stated by the above to approaches?Thanks for the additional info. Please see my comments. below.
Sorry should have been more specififc -
1. Is each application pool using a different JDBC user? You mentioned DatabaseConnection1 and DatabaseConnection2
above; are these connections to different schemas / users? If so, BC4J will create a separate connection pool for each
JDBC user. Each connection pool will have its own maximum pool size.
Each 'DatabaseConnection' refers to a different database, actually hosted on a seperate physical server, different
schema and different user.BC4J will maintain a separate connection pool for each permutation of JDBC URL / schema. If each user is connecting
to a different DB instance then I would expect no greater than 10 DB sessions. However, if a DB instance is hosting
more than user then I would expect greater than 10 DB sessions (though still no more than 10 DB sessions per user).
2. Are all the v$session sessions related to the JDBC clients? There should be at least one additional database
session which will be related to the session that is querying v$session.
When querying the v$session table I specifically look for connections from the user in quesiton and from the machine
name in question and in doing so eliminate the database system's connections, as well as the query tools'
connection. One area I'm not sure about is the connection BC4J uses to write to its temporary tables. I am using
Stateless release mode and have not explicetly stated to save to the database but I'm wondering if it still does if so
and how does it come into the equation with max connections?BC4J's internal connections are also pooled and the limits apply as mentioned above. So, if you have specified
internal connection info for a schema which is different than the users above I would expect the additional conns.
One helpful diagnostic tool, albeit programmatic, might be to print the information about the connection pools after
your test client(s) have finished. This may be accomplished as follows:
// get a reference to the BC4J connection pool manager
import oracle.jbo.server.ConnectionPoolManagerFactory;
import oracle.jbo.server.ConnectionPoolManagerImpl;
import oracle.jbo.pool.ResourcePool;
import java.io.PrintWriter;
import java.util.Enumeration;
// get the ConnectionPoolManager. assume that it is an instance of the supplied manager
ConnectionPoolManagerImpl mgr = (ConnectionPoolManagerImpl)ConnectionPoolManagerFactory.getConnectionPoolManager();
Enumeration keys = mgr.getResourcePoolKeys();
PrintWriter pw = new PrintWriter(System.out, true);
while (keys.hasMoreElements())
Object key = keys.nextElement();
ResourcePool pool = (ResourcePool)mgr.getResourcePool(key);
System.out.println("Dumping pool statistics for pool: " + key);
pool.dumpPoolStatistics(pw);
} -
Crystal Reports's JRC. How to close JDBC connection?
Hi!
I have simple CR JRC application under Oracle AS 10.1.2.0.2, made from Crystal's sample codes.
It works fine, but there is little problem: after closing vievwer's page JDBC connections stays alive.
How can I close them?
Here is my 2 jsp:
---------- Page1.jsp -----------------
"<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.crystaldecisions.reports.sdk.*" %>
<%@page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
<%@page import="com.crystaldecisions.report.web.viewer.*"%>
<%
// open the report rpt file
String REPORT_NAME = "directs_q_d1.rpt";
String Login =request.getParameter("p1");
String Password =request.getParameter("p2");
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open(REPORT_NAME, 0);
reportClientDoc.getDatabaseController().logon(Login,Password);
ParameterFieldController paramFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
paramFieldController.setCurrentValue("", "reportname", new String("DIRECTS_QUARTERLY"));
session.setAttribute("reportSource", reportClientDoc.getReportSource());
reportClientDoc.close();
response.sendRedirect("CrystalReportViewer.jsp");
%>
and
----------- CrystalReportViewer.jsp ------------------------
<%//Crystal Report Viewer imports.%>
<%@page import="com.crystaldecisions.report.web.viewer.*"%>
<%@page import="com.crystaldecisions.reports.sdk.*" %>
<%
//Refer to the Viewers SDK in the Java Developer Documentation for more information on using the CrystalReportViewer
//API.
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setOwnPage(true);
viewer.setOwnForm(true);
viewer.setPrintMode(CrPrintMode.ACTIVEX);
viewer.setHasRefreshButton(false);
viewer.setEnableDrillDown(false);
viewer.setDisplayGroupTree(false);
viewer.setHasToggleGroupTreeButton(false);
viewer.setHasViewList(false);
viewer.setHasLogo(false);
//Get the report source object that this viewer will be displaying.
Object reportSource = session.getAttribute("reportSource");
viewer.setReportSource(reportSource);
//Render the report.
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
viewer.dispose();
%>
-------------------------------------Oh, i'm sorry :) It was a "time-out" tag in CRconfig.xml. Tipic closed.
-
Report with JDBC connection does not work when they includes CommandTable
I am trying to render using the new version of Crystal report java component - CRJ a report contains Data base Fileds of type Command Table (Row Set) which seems to be not working.
when i use the previes version of crystal SDK it works fine.
after deugging the Sample CrystalHelper.java file which contains the method .changeDatasource()
i found that the DataBaseController.setLocation() method changes the CommandTable class to Table when using it on CommandTable instance and as result all the fields defined into that CommandTable were disappear.That appears to be a known issue: Eclipse JRC: To change the JDBC connection at run time
Sincerely,
Ted Ueda -
How to configure JDBC connection in oracle BI publisher with teradata datab
Hi,
I am going to use Oracle BI publisher to create report.
Our database is Teradata.
How to create database connection for Teradata in BI publisher.
How to create JDBC connection.
What should be the Database Driver Class?
What should be the connection string format?
Please provide me the suggetion.
Thanks,
Santanu MannaHi;
I suggest please refer below which could be helpful on your issue:
How To Generate XML Output (Excel, HTML, PDF) for FSG Reports [ID 804913.1]
E-XMLP: BI Publisher Report RTF Template to Excel output is not same as PDF,RTF or HTML format.[Article ID 1515711.1]
BI Publisher Enterprise Excel Output File Size is Too Large [ID 1271544.1]
Regard
Helios
Maybe you are looking for
-
Open analysis report in BI Publisher in OBIEE plus
Hi, I am unable to open a report in BI Publisher which was generated in analysis in OBIEE plus(11g). Previously I did it through Oracle BI Analysis+ in the Data Modle (Data Set). Now I am unbale to find the reports through same process. I noticed onl
-
Blue screen of death when syncing to iPod and iPhone.
I wish I could laugh. "Upgraded" to iTunes 8 and no longer can use my computer to sync to either my iPhone or my iPod. Thanks for the upgrade Apple. Now that I cannot update my portable music devices I have the extra time to stare at the new visualiz
-
does anyone know how to place a paragraph of text aligned to the very end/bottom of the region-body I don't want to use region-after because I need it for something else I tried using space, but I don't always know how much text there will be, so I w
-
To adjus the size of the box in the RMMAINgrapdhical view.
Hi, Can anybody know how to adjust the size of the box in the RMMAIN graphical view. I need to adjust the size of the boxes for evert actity so that all the phases can be seen at a shot. Regards, Srilu.
-
Changing scroll bars to buttons
Hello all, I use Macromedia Dreamweaver Mac for my wepage editing, I was wondering if anyone knows any helpful tutorials or instructions on how to replace the ugly grey scroll bars in your frames with arrow buttons or the like. Thanks much !!