INFORMIX JDBC Connectivity
Hi,
I try to connect to INFORMIX SE 7.25 Machine using con url:
jdbc:informix-sqli://hostIP:port/dbname:INFORMIXSERVER=servername;user=abc;password=xyz
The problem is that my database is not in the users' assigned space in the server. Instead it is in a different location/directory in the same server.
Is there a way I can point or use the full path of my database. How and where do I do that.
If I do:
sqli://hostIP:port/data/dbname:INFORMIXSERVER=servername;user=abc;password=xyz
I get error.
'/data' is the directory on the Linux server where the database is residing.
If some one knows Informix DBase well, will the DBPATH env variable will resolve this.
any help will be appreciated
cheers
Hassan
I've got it sorted.
If anyone is interested, here it is how.
Use javax.sql.DataSource connections as that API is more flexible and allow you to specify the full path of the Database.
Hassan
Similar Messages
-
I am using WebLogic 6.1sp2 and am trying to configure a JDBC connection to an Informix Database. How do I need to configure the database in order for the WebLogic JDBC drivers to be able to connect to it?
InformixPool(NonXA):
<JDBCConnectionPool
DriverName="com.informix.jdbc.IfxDriver"
InitialCapacity="3"
LoginDelaySeconds="1"
MaxCapacity="10"
Name="ifxPool"
Password="{3DES}EcGd4vppW7ClP0kGgLIm3A=="
Properties="user=informix;url=jdbc:informix-sqli://172.18.41.85:1543/syutils:informixserver=lcsol15;password=informix;dataSourceName=infPool;portNumber=1543;databaseName=sysutils;serverName=lcsol15;ifxIFXHOST=172.18.41.85"
Targets="myserver"
URL="jdbc:informix-sqli://172.18.41.85:1543/sysutils:informixserver=lcsol15"/>
InformixDataSource(NonXA):
<JDBCDataSource JNDIName="infPool1" Name="infPool1"
PoolName="ifxPool" Targets="myserver"/>
InformixXAConnectionPool:
<JDBCConnectionPool CapacityIncrement="1"
DriverName="com.informix.jdbcx.IfxXADataSource"
InitialCapacity="5"
MaxCapacity="10"
Name="infPool"
Properties="user=informix;url=jdbc:informix-sqli://172.18.41.85:1543/sys
utils:informixserver=lcsol15;password=informix;dataSourceName=infPool;portNumber
=1543;databaseName=sysutils;serverName=lcsol15;ifxIFXHOST=172.18.41.85"
RefreshMinutes="10"
SupportsLocalTransaction="true"
Targets="myserver"
TestConnectionsOnReserve="true"
TestTableName="emp"/>
InformixXADataSource:
<JDBCTxDataSource JNDIName="infPool" Name="infPool"
PoolName="infPool" Targets="myserver"/>
use similar configuration in config.xml for creating informix connection pool using weblogic in 610sp2.
Thanks,
Mitesh
Jonathan Mason wrote:
I am using WebLogic 6.1sp2 and am trying to configure a JDBC connection to an Informix Database. How do I need to configure the database in order for the WebLogic JDBC drivers to be able to connect to it? -
I have a problem when I tried to set up a jdbc connection in WL 11g.
- I create a new JDBC Data Source and put user=userpen in the Properties box under the Configuration/Connection Pool tab.
- When I go to Targets tab and check the AdminService box, click 'Save' and 'Activate changes' button, I got the following error messages:
An error occurred during activation of changes, please see the log for details.
weblogic.application.ModuleException:
weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: Incorrect password or user
com.informix.asf.IfxASFRemoteException: [email protected] is not known on the database server.
userpen is a valid user in the database server, but not [email protected]
It seems that the Weblogic attachs the computer name *@webtest.abc.com* to the end of the user name.
Can anybody let me know what can I do to stop Weblogic attaching the computer name to the user name.OK... When I try to make a DS for informix, using the IBM informix driver, it asks
me for the DB host machine, the DB name, the DB user name, the db password, and the
informix server name. when I give them values for those, it makes properties:
user=dbusername
url=jdbc:informix-sqli://DBMACHINE:1543/DBNAME:informixServer=IFMXSERVERNAME
portNumber=1543
databaseName=DBNAME
ifxIFXHOST=DBMACHINE
serverName=IFMXSERVERNAME
Does it do differently for you? -
Hi!
We're using Informix 7 + WL6sp1 + Informix JDBC Driver v2.2. We have a connection
pool and connect to the pool using:
Driver myDriver = (Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
con = DriverManager.getConnection("jdbc:weblogic:pool:poolname");
The problem is as follows:
Every time we modify a stored procedure (DROP ... CREATE ...) our app fails when
trying to use that stored procedure. We have to shut down the server and restart
it in order to keep going.
The stack trace:
java.sql.SQLException: SPL routine(disponibilidad_hot) is no longer valid.
at com.informix.jdbc.IfxSqli.addException(IfxSqli.java, Compiled Code)
at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java, Compiled Code)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java, Compiled Code)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java, Compiled Code)
at com.informix.jdbc.IfxSqli.sendStatementQuery(IfxSqli.java, Compiled
Code)
at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java, Compiled
Code)
at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java, Compiled
Code)
at com.informix.jdbc.IfxResultSet.executeQuery(IfxResultSet.java, Compiled
Code)
at com.informix.jdbc.IfxStatement.executeQueryImpl(IfxStatement.java,
Compiled Code)
at com.informix.jdbc.IfxPreparedStatement.executeQuery(IfxPreparedStatement.java,
Compiled Code)
at weblogic.jdbc.pool.PreparedStatement.executeQuery(PreparedStatement.java,
Compiled Code)
at es.gesfor.bd.ObtenerDatos.ejecutar(ObtenerDatos.java, Compiled Code)
at es.gesfor.servlets.FiltrosServlet.obtenerHoteles(FiltrosServlet.java,
Compiled Code)
at es.gesfor.servlets.FiltrosServlet.doPost(FiltrosServlet.java, Compiled
Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java,
Compiled Code)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java,
Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java, Compiled
Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)Hi Federico,
It happens because weblogic caches prepred statements.
Though the name of the stored procedure remains the same,
it's a different object from the database point of view, which is
why a mismatch between cache and database occurs.
You may consider setting size of the prepared statement
cache to zero. That should solve the problem. Later, when
the SP code is stabilized, you will be able to turn in on back.
Regards,
Slava Imeshev
"Federico Dios" <[email protected]> wrote in message
news:[email protected]...
>
Hi!
We're using Informix 7 + WL6sp1 + Informix JDBC Driver v2.2. We have aconnection
pool and connect to the pool using:
Driver myDriver = (Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
con = DriverManager.getConnection("jdbc:weblogic:pool:poolname");
The problem is as follows:
Every time we modify a stored procedure (DROP ... CREATE ...) our appfails when
trying to use that stored procedure. We have to shut down the server andrestart
it in order to keep going.
The stack trace:
java.sql.SQLException: SPL routine(disponibilidad_hot) is no longer valid.
at com.informix.jdbc.IfxSqli.addException(IfxSqli.java, CompiledCode)
at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java, CompiledCode)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java, CompiledCode)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java, CompiledCode)
at com.informix.jdbc.IfxSqli.sendStatementQuery(IfxSqli.java,Compiled
Code)
at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java,Compiled
Code)
at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java,Compiled
Code)
at com.informix.jdbc.IfxResultSet.executeQuery(IfxResultSet.java,Compiled
Code)
atcom.informix.jdbc.IfxStatement.executeQueryImpl(IfxStatement.java,
Compiled Code)
atcom.informix.jdbc.IfxPreparedStatement.executeQuery(IfxPreparedStatement.jav
a,
Compiled Code)
atweblogic.jdbc.pool.PreparedStatement.executeQuery(PreparedStatement.java,
Compiled Code)
at es.gesfor.bd.ObtenerDatos.ejecutar(ObtenerDatos.java, CompiledCode)
ates.gesfor.servlets.FiltrosServlet.obtenerHoteles(FiltrosServlet.java,
Compiled Code)
at es.gesfor.servlets.FiltrosServlet.doPost(FiltrosServlet.java,Compiled
Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,Compiled Code)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
Compiled Code)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java,
Compiled Code)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
Compiled Code)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java,Compiled
Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, CompiledCode) -
Concurrent Query through Informix JDBC
Hi,
I am using Informix Jdbc in my JSP ( Driver Downloaded from IBM Site). In case of concurrent calls to that Jsp , I am getting mixed result in the client site. It's written in the Informix JDBC Spec that "The Same statement or resultset instance cannot be accessed concurrently accross the threads". But what is the alternative way? Anybody found any solution....Any help appriciated.Hi k_dey,
I don't use Informix JDBC driver, but looking through the Informix JDBC Driver Programmer's Guide UNIX and Windows Environments, V2.21, it appears that statement caching is enabled by setting the STMT_CACHE environment variable to 1 (one). Unfortunately, I couldn't find anything in the guide on how to disable statement caching, so I searched the archives of the "comp.databases.informix" newsgroup (for the word 'STMT_CACHE') and it seems that if you set it to 0 (zero), it disables statement caching.
The guide says that you can set these environment variables through JDBC by either including NAME=VALUE pairs in the database connection URL, or supplying a "java.util.Properties" object as a parameter to the "getConnection()" method (in class "java.sql.DriverManager").
According to the guide, this is the format for the URL:
jdbc:informix-sqli://[{ip-address|host-name}:port-number][dbname]:
INFORMIXSERVER=server-name;[user=user;password=password]
[;name=value[;name=value]...]
So I guess you just need to write:
;STMT_CACHE=0instead of
;name=valueAnd here is some slightly modified code, also taken from the guide:
Properties pr = new Properties();
pr.put("STMT_CACHE","0");
conn = DriverManager.getConnection(newUrl, pr);The guide says that you must use only one of the above two methods, i.e. either set the environment variable in the URL, or use the "Properties" parameter.
Hope this helps.
Good Luck,
Avi. -
Hi,
I am connecting to Informix server using JDBC in a stand alone application. After every 20 or 25 connections being made to database, before issuing a new connection, JVM takes about 3 to 4 minutes between issuing or getting the connections. if I use the verbose option, this is what it seems to loop at before proceding, any clue on what might be happening.
[Signaling in VM: java/lang/reflect/InvocationTargetException, message: ]
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.informix.jdbc.IfxDriver.connect(IfxDriver.java:249)
at java.sql.DriverManager.getConnection(DriverManager.java:543)
at java.sql.DriverManager.getConnection(DriverManager.java:163)
at com.walmart.javaapps.DBInformix.doIt(DBInformix.java:3829)
at com.walmart.javaapps.DBInformix.main(DBInformix.java:3803)I tried, you have better chance of finding something
on google than IBM site.
We have escalated the issue to IBM, we are waiting for
response from them, and waiting to find out what they
have to say about it.
If i hear somethign ,I will post it here.sorry to hear that.
do you have source for the driver? because i'd take a look at line 249 of com.informix.jdbc.IfxDriver and see what the heck's it's doing. -
WebLogic Informix JDBC driver query
We are developing an application with WL6.1 Express. One of the databases
we need to connect to is Informix 7.2. Since WL's jDriver can work with
Informix, I'd assume we do not need to buy any additional drivers from IBM.
1) Is my assumption correct?
2) Not having worked with Informix before, what needs to be done on the
Informix server to enable this connection?
3) Is the WL jDriver for Informix reliable or are we better off buying the
Informix JDBC driver?
Appreciate any advice on the matter, thanks.Kai wrote:
>
We are developing an application with WL6.1 Express. One of the databases
we need to connect to is Informix 7.2. Since WL's jDriver can work with
Informix, I'd assume we do not need to buy any additional drivers from IBM.
1) Is my assumption correct?yes.
2) Not having worked with Informix before, what needs to be done on the
Informix server to enable this connection?that should be documented in our stuff.
3) Is the WL jDriver for Informix reliable or are we better off buying the
Informix JDBC driver?The one from Informix is better. Last time I checked, Informix's driver was free.
Unless it is expensive, I recommend it.
Joe Weinstein
>
Appreciate any advice on the matter, thanks.--
B.E.A. is now hiring! (12/14/01) If interested send a resume to [email protected]
DIRECTOR OF PRODUCT PLANS AND STRATEGY San Francisco, CA
E-SALES BUSINESS DEVELOPMENT REPRESENTATIVE Dallas, TX
SOFTWARE ENGINEER (DBA) Liberty Corner, NJ
SENIOR WEB DEVELOPER San Jose, CA
SOFTWARE ENGINEER (ALL LEVELS), CARY, NORTH CAROLINA San Jose, CA
SR. PRODUCT MANAGER Bellevue, WA
SR. WEB DESIGNER San Jose, CA
Channel Marketing Manager - EMEA Region London, GBR
DIRECTOR OF MARKETING STRATEGY, APPLICATION SERVERS San Jose, CA
SENIOR SOFTWARE ENGINEER (PLATFORM) San Jose, CA
E-COMMERCE INTEGRATION ARCHITECT San Jose, CA
QUALITY ASSURANCE ENGINEER Redmond, WA
Services Development Manager (Business Development Manager - Services) Paris, FRA; Munich, DEU
SENIOR SOFTWARE ENGINEER (PLATFORM) Redmond, WA
E-Marketing Programs Specialist EMEA London, GBR
BUSINESS DEVELOPMENT DIRECTOR - E COMMERCE INTEGRATION San Jose, CA
MANAGER, E-SALES Plano, TX -
Refreshing JDBC Connection Pools after database restart
Hi Patricia,
Did you try to turn on testOnReserve for your connection pool?
Regards,
Slava Imeshev
"Patricia Albano" <[email protected]> wrote in message
news:3c0e3bff$[email protected]..
Hello,
I have a similar problem.
I have a WLS 6.0 SP2 running on SunOS 5.6 Generic_105181-23 sun4u sparcSUNW, Ultra-60.
I have a JDBC pool created in my weblogic server, withcom.informix.jdbc.IfxDriver driver. However, and in spite of the indication
regarding the refresh period, the connections are not refreshed. Whenever
the DB is down or, for some other reason the connections failed, they just
don%u2019t recover on their own.
We tried to use weblogic jdriver for Informix, but it doesn%u2019t solveour problem for we have some requirements that only work with the
com.informix.jdbc.IfxDriver.
>
Is there some patch that we can use to solve our problem, like in Oracledatabase?
>
Thanks
mail to: [email protected] -
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);
} -
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.
Maybe you are looking for
-
Uploading field from excel sheet only of length 4 into SAP Table
Dear Friend, I want to upload fields like Compny Code & Business Area of length 4 characters into SAP Tables. But in the excel sheet at some places Co Code & Business Area of length less than 4 characters is maintained which I want to ignore ie. thos
-
Save PDF to Web Receipts Folder
I have performed an archive and install of Mac OS X Leopard and have upgraded to v. 10.5.1. The PDF drop-down menu appears in the Print Dialog. When I click on Save PDF to Web Receipts Folder, the command executes, but no PDF appears in my Web Receip
-
Yosemite Reinstall --- Failure --- Please Help!!
Hello, please help me. Just don't know what to do now. Just had an Driver-Update-Crash due letting installing and auto-reboot two drivers (RME AudioDriver and Airdisplay2 Driver) and suddenly my MacBook Pro (Mid2012) didn't passed the grey startup sc
-
Macbook Pro won't turn on when scheduled
I recently bought a refurbished macbook pro ad I've set it to shut off at night and then wake up in the morning. Well-it shuts off fine when it's supposed to but it never turns on in the morning. I have no actual problems turning the computer on manu
-
I have just today started to use Goggles Mapping. Is there anyone who can get me started with this App? I am using a I-pad. Thank you,