Issue with Connection Pooling in ias 8i
We keep running out of connections on a regular basis. We have checked out the JSP code and we are closing the connections at the end of every JSP, which I think should return the connections back to the Pool. The max process from the database side has already been set to the maximum value. How can we check if the connections are being returned back to the pool or not. Is this a problem that has patch of a fix in 9i ?
Thanks
Venkat
Java exception mechanism makes it very hard to write exception-safe code so that the connections are returned to the pool if something goes wrong.
try {
Connection conn = ...
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(..);
rs..
rs..
stmt.close();
conn.close();
} catch(SQLException ex) {}
for example the above code is not exception safe. If there is an error while you are working with the resultset, the connection remains open. Instead :
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
conn = ...
stmt = conn.createStatement();
rs = stmt.execute...
}catch(SQLException ex){}
finally{
try{
if(rs!=null) rs.close();
}catch(SQLException){}
try{
if(stmt!=null) stmt.close();
}catch(SQLException){}
try{
if(conn!=null) conn.close();
catch(SQLException){}
You see how stupid the code gets to make it exception safe. I think we can put the blame on the close() methods throwing an SQLException. What can you do if close() fails really. To my mind it is very stupid.
Similar Messages
-
What is the usual way of accessing Oracle by JSF with connection pooling?
I am writing to access Oracle by JSF with connection pooling.
EJB is too difficult for me.
What is the simple way of doing it?
thanksLeung,
I believe there should be some sample code available via the JavaServer Pages Samples Web page.
Good Luck,
Avi. -
Stored Procedure Call with Connection Pools
Hi everybody,
I have changed my Database-Connection to Connection Pooling.
No I try to call a stored procedure like this:
Connection connection;
CallableStatement callStmt;
Integer sp_result;
//--- Set callable stored procedure
String call = "{?=call myStoredProcedure(?,?,?)}";
try {
if( connection != null ) {
callStmt = connection.prepareCall( call );
callStmt.registerOutParameter( 1, java.sql.Types.INTEGER );
callStmt.setInt( 2, 3 );
callStmt.setString( 3, plz );
callStmt.setString( 4, ort );
callStmt.execute( call );
sp_result = new Integer( callStmt.getInt(1) );
callStmt.close();
result = sp_result.intValue();
} else {
log.error( "Connection = null" );
} catch( SQLException ex ) {
log.error( ex.toString() );
ServletUtils.forwardRequest(this, request, response,
"/error.jsp", "errorMsg", ex.toString() );
Without Connection Pooling, my Connection is of
'weblogic.jdbc.mssqlserver4.MicrosoftConnection'
With Connection Pooling my Connection is of
'weblogic.jdbc2.rmi.SerialConnection'
And now, the stored procedure can't be found anymore.
There comes an SQLException:
Gespeicherte Prozedur 'myStoredProcedure' konnte nicht gefunden werden.
Severity 16, State 62, Procedure 'myDBServer null', Line 5
One possibility is that the SerialConnection can't call the stored procedure
like the Microsoft-specific Connection (I use MS-SQL-Server)
Another is that the call have to be another stucture.
I would be pleased if somebody is expirienced in this behaviour.
Thousand thanx,
Hammer.You need to use a DataModifyQuery as your query does not return anything.
James : http://www.eclipselink.org -
ODI 11.1.1.7.0 connect to DB with connection pool
Hello!
ODI standalone agent 11.1.1.7.0 now make a connect to DB with connection pool and set "client identifier" in the session.
How to disable connection pooling?
Thank youSolved by downloading and installing
Version 11.1.0.7.0
Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications
from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html. -
Where can I get a db2 jdbc driver with connection pool
hi,all
I want to look for a free jdbc driver to connect to db2 using with connection pool.
it isn't present in db2java.zip
thanks and regards
[email protected]To find JDBC drivers take a look at SUN's overview at http://industry.java.sun.com/products/jdbc/drivers
-
How can i improve database connectivity with connection pool
Hi,
I used to create a connection to DB per session since the application is pretty small. Now i want to improve the db connectrion with connection pool. However, i am still confused since the book i read says that i have to change something in server.xml in the tomcat server while other people in this forum actually implement a connection pool class. Isnt it has been built into the servlet container? if yes, how can i use it? I suppose i only have to open the connection and the connection pool will reclaim the resource when the session is terminated in the same way the gabage collector reclaim resource when no reference is associated to object, am i correct?
Thaithe documentation for Tomcat 5 DB pooling can be found at:
http://jakarta.apache.org/tomcat/tom...les-howto.html
Here are the Tomcat 4 docs:
http://jakarta.apache.org/tomcat/tom...les-howto.html
The administration console can be found at (under default install):
http:localhost:8080/admin
But, you have to set up a user and password in your
<tomcat-install>/conf/tomcat-users.xml file.
You need to add an "admin" role and a user that will be assigned this
role like this (obviously you won't be using "tomcat" as your password):
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="admin"/>
</tomcat-users>
So, I can log in as Tomcat and have admin privs.
Tomcat 5
http://jakarta.apache.org/tomcat/tom...ger-howto.html
Tomcat 4
http://jakarta.apache.org/tomcat/tom...ion%20A ccess
i'm sure this helps u -
I'm having issues with connecting my iPhone 4 to iTunes?
Here's some information:
Apple product: iPhone 4
Computer: Windows 8 (originally) to Windows 8.1 (upgraded version)
Okay, I'm having issues with connecting my iPhone 4 to iTunes. I've connected it via U.S.B. and now everything's not working right the 10th time. Am I to redownload the iTunes software once again or will I never be able to add music anymore?OffTime wrote:
What do you mean with logging?
Hans
Close any open applications.
Click the Apple icon top left of the screen.
Select the bottom option in the cascading menu: Log Out (your user name).
Log in a Guest.
This will dertermine if there is a problem with your Admin account.
Al -
How to config the oracle database connection pool in IAS
Hi,
Does anyone who hows to config the oracle database connection pool in IAS?
Thanks so much!!!
[email protected]
JackyJacky,
You need do the following for oracle type4 driver:
1) register the driver:
$IAS_HOME/bin/jdbcsetup
Driver Identifier: Oracle_Type4_816 (whatever name you like)
Driver Classname: oracle.jdbc.driver.OracleDriver
Driver Classpath: .../classes12.zip (install this this zip file somewhere
and add this zip into the Classpath later).
2) DataSource Setup:
start iAS Administration Tool (iASAT)
Choose Database, unfold iAS1 (your app server instance),
choose External JDBC Datasource -> add: DataSource Registration
JNDI Name: yourPoolName
Driver Type: Oracle_Type4_816 (select what you just register)
DataSource Url: jdbc:oracle:thin:@hostName:portName:dbName
Username: your_user_name
Password: your_passwd
(Datasource Pool: using defaults for now): you can also customrize the
parameters for the pool.
3. Add classes12.zip into CLASSPATH.
In your application, you can use JNDI lookup to get the DataSource from
which you get the connection from the pool.
Hope this helps.
Good luck.
Xuran
"Jacky Yan" <[email protected]> wrote in message
news:9m0tmp$[email protected]..
Hi,
Does anyone who hows to config the oracle database connection pool in IAS?
Thanks so much!!!
[email protected]
Jacky -
I am having issues with connecting to the store...the page just hangs and when I run Diagnostics it states that a secure connection could not be established.
I have contacted apple via email and tried all the steps they have recommended and it is still not working.
I have tried disabling my McAfee and that does not work either.
Anyone that the phone number to apple express so I don't have to keep waiting for them to email within 48 hours?
Thanks.With those symptoms, I'd try the following document:
Apple software on Windows: May see performance issues and blank iTunes Store
(If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.) -
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.
-
Weblogic 9.2 - Problem with Connection Pool not releasing resources
We have a third party application that is running Weblogic 9.2 and has a connection pool to a SQL 2005 db for queries within it's batch process. What I have noticed is that it does not seem to be releasing SQL cpu back after the batch and this is causing issues with processes for other dB's within the instance. Has anyone encountered this issue and if so what is the solution (short of isolating it within it's own instance). Can the connection be reset to release resources?
Yes it is a weblogic connection pool. What I mean is that when a batch run I can see the CPU for the SQL process associated with the connection increase but when the batch is completed the CPU remains high when I would expect it to move back down to an 'idle' level as after that as all it would be doing is the occasional "select 1' ping to keep the connection active.
What i do see is that the cpu in activity monitor shows high cpu and it never goes down unless the connection is killed and re-established. As this is a shared instance other apps are complaining of slow running procs. -
hi,
I have problems with Weblogic 5.1 connection pool. Normally it works
fine, but
under heavy load the connection pool doesn't work at all: it
negotiates a new connection every time.
Has anyone else had problems like this?
regards, EKMitesh Patel wrote:
What is your max capacity of the pool? Generally, max capacity value of
the pool should be no. of concurrent users connecting to database at
peak load.Hi Eino. Actually, I'll disagree temporarily with Mitesh ;-)
If your application is designed so that all JDBC work is done
during a single client-server invoke, such as in stateless session
beans, or servlets etc, you should only need as many connections
in the pool as your server has execute-threads. This is because
each thread will be handling one client at a time, and as long as
the code gets a pool connection, uses it, and closes it during the
one invocation, the closed connection will be there for the next.
one.
Let me see your pool definition. The only issue that may
cause occasional problems like you see, is if pool refresh is
running. Pool refresh will temporarily reserve all the currently-
unused pool conenctions to test them, and during this time, any
incoming application demand will cause the pool to make new connections
(or throw an exception!) to meet demand. If you have testConnsOnReserve
set to true, this is all the pool checking you need IMO. I would set
the refresh minute parameter to 99999999 to effectively turn off
refresh. I'm betting that will solve your issue. Let me know...
Joe
>
>
Mitesh
Eino Komsi wrote:
hi,
I have problems with Weblogic 5.1 connection pool. Normally it works
fine, but
under heavy load the connection pool doesn't work at all: it
negotiates a new connection every time.
Has anyone else had problems like this?
regards, EK -
Critical issue with Connection.setReadOnly on WebLogic
Hi All,
We've just hit a critical issue while running on WebLogic.
After establishing a connection from a connection pool, we set the ReadOnly status to true on the Connection.
(We do this so user entered SQL can be executed)
In testing, we put in a DELETE FROM TEST_TABLE_NAME command, and the code is actually performing the delete.
(Updates the same)
I've connected a remote debugger and seen that the ReadOnly flag is set to true inside the connection Object.
This is how my connection pool is configured........
driver class name: oracle.jdbc.OracleDriver
properties:
user=V42_ISMART_DEMO_USER
ejb=sisPool
class=oracle.jdbc.pool.OracleConnectionPoolDataSource
protocol=thin
xa-location=jdbc/xa/sisPool
Transaction is using One-Phase commit.
database is 11.1.0.7.0
Weblogic 10.3
Java 1.6
Any pointers in the right direction would be greatly appreciated, as this is currently blocking a product release.
Thanks,
RonanDo tell us more about the product release and how this issue has come to
block it. How does the behavior you see differ from anything earlier in your
development cycle!
You have already taken WebLogic out of the equation be confirming that
the read-only setting is passed to the driver's connection object, so this is
only a driver issue. You could take it up in the JDBC forum, but the main
issue is probably that you have not investigated the specified semantics of
setReadOnly(). From a user perspective, it sounds like it might be intended
to stop any user SQL from altering the DBMS, though with deeper thought
on the issue, that could only be implemented at the DBMS itself. The driver
could never know if a stored procedure you call or a trigger on a select
query you make altered the DBMS.
The spec for the call, however, carves out a totally different and vastly
less interesting meaning to the method:
"Puts this connection in read-only mode as a hint to the driver to enable
database optimizations. "
This allows the driver to totally ignore the input in cases where it does not
enable any 'dbms optimizations' which it does not in this case, so the driver
does ignore the setting, except to helpfully return it to you later if you should
call getReadOnly()... ;)
HTH,
Joe -
Cursor bound to out parameter with Connection Pool
Is it possible to retrieve a cursor bound to an out parameter when using the thin
driver to establish the connection pool to the database? I am currently using
the JDriver to connect create the pool and the pool driver to connect from the
app to the connection pool. We'd like to avoid using the Oracle client if possible.
Currently I register the out parameter as java.sql.Types.OTHER, then call getResultSet(1)
on the weblogic.jdbc.pool.CallableStatement object. But it breaks when I change
the connection pool to use the thin driver. The error is at the bottom of this
post.
I think I could possibly get the current pool driver to work if can find some
documentation on these two methods:
void registerOutParameter(int i, int j, int k, int l)
void registerOutParameter(int i, int sqlType, java.lang.String typeName)
I have no idea what to put in for the ints in the first method or for sqlType
or typeName. Can anyone point me to where I can find this documentation?
E-docs mentions this class: weblogic.jdbc.vendor.oracle.OracleCallableStatement.
(http://edocs.bea.com/wls/docs61/jdbc/thirdparty.html#1023867). Should I consider
this? If so where is it?
Thanks a lot,
Matt Savino
<<< error when using thin driver >>>
preparing callable stmt
callable stmt prepared, java.sql.Types.OTHER = 1111
java.sql.SQLException: Invalid column type
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
at weblogic.jdbc.pool.Statement.registerOutParameter(Statement.java:617)
at jsp_servlet._reportmanager.__thin_outputresultset._jspService(__thin_outputresultset.java:145)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)Thanks Joe, your answer pointed me in the right direction. Just in case anyone
wants to know, the solution took two changes:
CHANGE
cStat.registerOutParameter(1, java.sql.Types.OTHER);
TO
cStat.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.CURSOR);
(cStat is an instance of weblogic.jdbc.pool.CallableStatement)
AND
rs = cStat.getResultSet(1);
TO
rs = cStat.getCursor(1);
Thanks again,
Matt
Joseph Weinstein <[email protected]> wrote:
Hi Matt.
Look at the Oracle thin driver documentation to determine what type you
should define in the registerOutParameter call. We use 'OTHER', but
their driver may use something else for CURSOR output parameters.
joe
Matt Savino wrote:
Is it possible to retrieve a cursor bound to an out parameter whenusing the thin
driver to establish the connection pool to the database? I am currentlyusing
the JDriver to connect create the pool and the pool driver to connectfrom the
app to the connection pool. We'd like to avoid using the Oracle clientif possible.
Currently I register the out parameter as java.sql.Types.OTHER, thencall getResultSet(1)
on the weblogic.jdbc.pool.CallableStatement object. But it breaks whenI change
the connection pool to use the thin driver. The error is at the bottomof this
post.
I think I could possibly get the current pool driver to work if canfind some
documentation on these two methods:
void registerOutParameter(int i, int j, int k, int l)
void registerOutParameter(int i, int sqlType, java.lang.String typeName)
I have no idea what to put in for the ints in the first method or forsqlType
or typeName. Can anyone point me to where I can find this documentation?
E-docs mentions this class: weblogic.jdbc.vendor.oracle.OracleCallableStatement.
(http://edocs.bea.com/wls/docs61/jdbc/thirdparty.html#1023867). Should
I consider
this? If so where is it?
Thanks a lot,
Matt Savino
<<< error when using thin driver >>>
preparing callable stmt
callable stmt prepared, java.sql.Types.OTHER = 1111
java.sql.SQLException: Invalid column type
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
at weblogic.jdbc.pool.Statement.registerOutParameter(Statement.java:617)
at jsp_servlet._reportmanager.__thin_outputresultset._jspService(__thin_outputresultset.java:145)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
PS: Folks: BEA WebLogic is expanding rapidly, with both entry and advanced
positions
for people who want to work with Java, XML, SOAP and E-Commerce infrastructure
products.
We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and San Jose
CA.
Send resumes to [email protected] -
Issues with connection to Officejet Pro 8500
Hi folks,
I have a user at home with a Officejet 8500 connected to a BT home hub via wifi. it worked initially when we set it up a few months back however rarely and intermitantly since then. It notmally shows as offline in print properties and the HP app cant connect to it.
Some network basics
Router IP: 192.168.1.254
Printer IP: 192.168.1.66 (via DHCP)
Alt Printer IP: 192.168.1.100 (Static IP Attempt with no joy)
Other devices in network:
Desktop pc (Not work kit)
Iphone (his wifes)
Laptop PC (work kit)
We do have him connected via VPN however Im inclined not to believe that its aproblem witht hat as we have a dozen users with the same setup and the VPN dosent cause them headaces.
Pining the hostname of the printer results in a weird IP external IP address (87.239.20.209) not the local one. Ok so I put a change in the hostfile to point to the Printers IP. No joy there.
Tried a static IP.... you know just cos... (and in my mind best practice for a printer anyway!)
So Any ideas or any one experianced similar issues with this?
Cheers in advanced folksWe have been having offline issues with this same printer. I have tried to install all new software to a Win 7 64 bit computer but the full software cannot complete. It detects the printer on the network, goes through the network settings but when it gets to Installing Your Printer, it fails with this statement: 'Printer setup has failed to complete. Click retry to try installing the printer again or click next to continue installation without connecting to the printer now.'
Now, I am connected via the web to the printer and all is well on the status screen. I have updated the firmware too. I read through many blogs of others having the same issue with no real resolution. All those that were connected to it are now showing 'offline' even though they can ping it and access it directly on the web - but none can print. I have tried downloading and installing the HP Print and Scan Doctor but it needs the 'full' software installed in order to run.....but the full software cannot complete it's install because of the above.
I have always loved HP printers but this one deserves to be in the land fill!
Maybe you are looking for
-
My macbook pro freeze up have to shut down
My macbook freezes up then i have to shut down when it starts i get a blinking file. Then i restart it it comes up i cleared cache i ran disc utility finds nothing wrong with it can some on help me i updated purchased lion my garageband effect bar di
-
BI Beans under OC4J with a lot of errors -- !HEPL!
All I have built some dimensions and cubes through BI Beans . but once all of them finished it will drop into an error. when I request a Presentation object(cross table) through web client,the console shows following: Fri Jun 18 21:49:21 CST 2004 TRA
-
IPhoto Card Builder and Ordering Service Troubleshooting
Created an invitation card with photos using iPhoto's build a card feature. Completed the project and clicked "Buy Card." Went through the payment information window, then submitted the order. The charge went through just fine, but on project uploa
-
Uninstalled software deployed by SCCM still remains in Installed Applications
Hi experts I noticed when we manually uninstalled a software which was deployed via SCCM, in Software Center, under Installed Applications, the software is still listed as installed there. I know the only way to make the software unlisted under Soft
-
Exporting video help...
o.k. here it is. I'm not a pro but I'm not new to fcp. I mostly film and edit church events, and they are mostly an hour to an hour and a half long. So I've never had a problem exporting the project to DVD Studio Pro. Their really simple edits (title