Connection pool replacement in NW
hi,
does anyone know if the connection pools that could be created in EP6SP2 via System Configuration->Knowledge Management->Content Management->Utilities->Connection Pool have been replaced in NW? I've noticed they are no longer available, so does anyone know if it is possible to create such a connection pool in NW and how?
Does anyone know where the connection pool configurations are available in the system (for NW)? (for example where is dbcon_wcmdb_cm connection pool configuration file located)
Thank you,
adina
Hi Adina,
that's not going to work on NetWeaver. Please note that the CMRepositoryManager has been rewritten to use OpenSQL statements to retrieve data from the database. These are "generic" statements that work on any database supported by NetWeaver. What happens at runtime is that the sql statement that the application (e.g. KMC) passes on to the OpenSQL implementation which runs the statement through a statement parser and based on information taken from the java dictionary it compiles a new sql statement that the underlying native database accepts. On the way back from the database to the application the inverse operations take place, e.g. native result sets are turned into OpenSQL result sets.
Now, in 6.40 there is a restriction in the OpenSQL implementation of the j2ee engine that allows to talk OpenSQL to only one database. So even if you would configure a different dbpool pointing to your own database then that's not supported by OpenSQL, meaning that pool would only work with native SQL.
And that's the point where the real problem comes in: the sql statements used in the 6.40 version of the CMRepMgr won't be understood by the any native database.
So I'm very sorry to disappoint you but it won't work this way.
Similar Messages
-
Replace Quotes, Connection Pooling, and Sun Web Server with MySQL, Oracle
This is code I use to insert data into my MySQL and Oracle databases.
I takes care of quotes and shows use of context, i.e. when you use Sun Web Server's
ConnectionPooling. This code works. Feel free to reply if you have questions on how to set up connection pooling using Sun Web Server 6.1SP - it took quite a long time to learn and I couldn't find much information throughout the web, so I hope this helps...
This is not a question and I am not looking for an answer, but please post comments or suggestions.
dailysun
This is in one class where I have a hashtable containing the
column name / value pairs that I want to enter into my table.
This class simply creates the SQL string from the values in the
hashtable. It then passes that hashtable including the database
name to a class which executes that sql statement (second code
portion).
/* Insert data into sf_parts. Create the column strings from
* the provided hash table. Be sure to parse out hash elements which
* are used for the createTemplate process
StringBuffer values = new StringBuffer();
StringBuffer fields = new StringBuffer();
Enumeration keys = fieldHash.keys();
while(keys.hasMoreElements()){
Object currentKey = keys.nextElement();
String fieldValue = (String) fieldHash.get(currentKey);
if(values.length() >0){
values.append(",");
values.append("'"+fieldValue.replaceAll("'","''")+"'"); // Takes care of quotes and various other special characters!
if(fields.length() >0){
fields.append(",");
fields.append(currentKey);
sql = "INSERT INTO myTable (" + fields.toString() + ") VALUES (" + values.toString() + ");";
String insertResult = caq.getInsertDelete(sql,"myDatabaseName"); // your database name is defined in web.xml and sun-web.xml when you use Sun Web Server's Connection Pooling.
returnValue += "<br><br><b>Rows inserted into table(myTable): </b>" + insertResult + "<br>\n";
And, like I describe above, this method executes the sql statement.
* Takes care of insert, update and delete requests.
* Must have set both dbName as well as the sql String.
* Will return number of rows affected as String.
* @return String Number of rows affected
* @exception SQLException
* @exception Exception
public String getInsertDelete() {
checkData(); // this simply checks if the variables dbName and sql are not empty ;-)
InitialContext initContext = null;
int rv = 0;
try{
// Get connection from configured pool
initContext = new InitialContext();
source = (DataSource) initContext.lookup("java:comp/env/jdbc/" + dbName); // I have this set up in web.xml and sun-web.xml (I use Sun Web Server 6.1SP which does connection pooling for me)
conn = source.getConnection();
if(conn != null){
stmt = conn.createStatement();
rv = stmt.executeUpdate(sql);
}catch (SQLException e){
// do something
}catch (Exception e){
// do something
}finally{
try{
stmt.close();
}catch(Exception e){
// do something
try{
conn.close();
}catch(Exception e){
// do something
try{
initContext.close();
}catch(Exception e){
// do something
return rv+"";
}This is code I use to insert data into my MySQL and
Oracle databases.
I takes care of quotes and shows use of context, i.e.
when you use Sun Web Server's
ConnectionPooling. This code works. Feel free to
reply if you have questions on how to set up
connection pooling using Sun Web Server 6.1SP - it
took quite a long time to learn and I couldn't find
much information throughout the web, so I hope this
helps...
This is not a question and I am not looking for an
answer, but please post comments or suggestions.Using prepared statements would mean that you wouldn't have to worry about quotes.
You should be closing the result set.
You are handling all fields as strings. That won't work with time fields and might not work for numeric fields.
Presumably most of your variables are member variables. They should be local variables because that is the scope of the usage.
You must do something with the exceptions.
Hashtables although convienent mean that problems with usage can only be resolved at run time rather than compile time. -
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 -
Database log switch and WLS connection pool relation
Hi,
We have been facing WLS JDBC connection pool disable and suspension issue very frequently in our environment and as a work around have implemented multi-datasource configuration (fail over method).
But we need to know the root cause for the same and want to fix the issue too.
We have tried many options like increasing no. of processes and transaction on Database, fine tune the weblogic datasource but still we could not isolate the issue.
Recently we have been advised to minimize the log switch on database front and increase the redo log size. Not sure if this will help in isolating the issue or not.
So we are Looking forward for the comments and suggestions on what would be the relationship b/w datasource and log switch be and if someone have faced this issue and resolved the same by fine tuning the database and minimizing the log switch.
We are using WLS 10.3.3.0
-Rohitturn on jdbc logging. The server log should be showing the troubles WLS is having
while testing connections and trying/failing to make replacement connections. -
Has anyone run the connection pooling for mysql & tomcat successfully?
I'm trying to set up connection pooling. I'm following the how-to page at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
But when i test the DBTest/test.jsp file, tomcat displays an error =
could not load jdbc driver class 'null'(msdos)
i have placed all the required .jar files in the tomcat lib.
below is the cofiguration i did to the server.xml file
<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other -->
<!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port.
Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<!-- Uncomment these entries to enable JMX MBeans support -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" (and therefore the web applications visible
within that Container). Normally, that Container is an "Engine",
but this is not required.
Note: A "Service" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the
associated "Container" (normally an Engine) for processing.
By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
You can also enable an SSL HTTP/1.1 Connector on port 8443 by
following the instructions below and uncommenting the second Connector
entry. SSL support requires the following steps (see the SSL Config
HOWTO in the Tomcat 4.0 documentation bundle for more detailed
instructions):
* Download and install JSSE 1.0.2 or later, and put the JAR files
into "$JAVA_HOME/jre/lib/ext".
* Execute:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
with a password value of "changeit" for both the certificate and
the keystore itself.
By default, DNS lookups are enabled when a web application calls
request.getRemoteHost(). This can have an adverse impact on
performance, so you can disable it by setting the
"enableLookups" attribute to "false". When DNS lookups are disabled,
request.getRemoteHost() will return the String version of the
IP address of the remote client.
-->
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8081 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="100" debug="0" scheme="https" secure="true"
useURIValidationHack="false" disableUploadTimeout="true">
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
</Connector>
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="20000"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
-->
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8082" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" useURIValidationHack="false" />
-->
<!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
<!--
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8083" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" />
-->
<!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
<!--
<Connector className="org.apache.catalina.connector.http10.HttpConnector"
port="8084" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" />
-->
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host). -->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Standalone" defaultHost="localhost" debug="0">
<!-- The request dumper valve dumps useful debugging information about
the request headers and cookies that were received, and the response
headers and cookies that were sent, for all requests received by
this instance of Tomcat. If you care only about requests to a
particular virtual host, or a particular application, nest this
element inside the corresponding <Host> or <Context> entry instead.
For a similar mechanism that is portable to all Servlet 2.3
containers, check out the "RequestDumperFilter" Filter in the
example application (the source for this filter may be found in
"$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
Request dumping is disabled by default. Uncomment the following
element to enable it. -->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->
<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
<!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC -->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test" connectionPassword="test"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
connectionName="scott" connectionPassword="tiger"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/my-jsp" docBase="c:\JSP-Files" debug="0"
privileged="true" reloadable="true" />
<Context path="" docBase="c:\Inetpub\wwwroot" debug="0" privileged="true" />
<Context path="/sharon" docBase="C:\Tomcat 4.1\webapps\sharon" debug="0" privileged="true" />
<!-- Normally, users must authenticate themselves to each web app
individually. Uncomment the following entry if you would like
a user to be authenticated the first time they encounter a
resource protected by a security constraint, and then have that
user identity maintained across all web applications contained
in this virtual host. -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
-->
<!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory.
-->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<!-- Define properties for each web application. This is only needed
if you want to set non-default properties, or have web application
document roots in places other than the virtual host's appBase
directory. -->
<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->
<!-- Tomcat Examples Context -->
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>
<!-- If you wanted the examples app to be able to edit the
user database, you would uncomment the following entry.
Of course, you would want to enable security on the
application as well, so this is not done by default!
The database object could be accessed like this:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
UserDatabase database =
(UserDatabase) envCtx.lookup("userDatabase");
-->
<!--
<ResourceLink name="userDatabase" global="UserDatabase"
type="org.apache.catalina.UserDatabase"/>
-->
<!-- PersistentManager: Uncomment the section below to test Persistent
Sessions.
saveOnRestart: If true, all active sessions will be saved
to the Store when Catalina is shutdown, regardless of
other settings. All Sessions found in the Store will be
loaded on startup. Sessions past their expiration are
ignored in both cases.
maxActiveSessions: If 0 or greater, having too many active
sessions will result in some being swapped out. minIdleSwap
limits this. -1 means unlimited sessions are allowed.
0 means sessions will almost always be swapped out after
use - this will be noticeably slow for your users.
minIdleSwap: Sessions must be idle for at least this long
(in seconds) before they will be swapped out due to
maxActiveSessions. This avoids thrashing when the site is
highly active. -1 or 0 means there is no minimum - sessions
can be swapped out at any time.
maxIdleSwap: Sessions will be swapped out if idle for this
long (in seconds). If minIdleSwap is higher, then it will
override this. This isn't exact: it is checked periodically.
-1 means sessions won't be swapped out for this reason,
although they may be swapped out for maxActiveSessions.
If set to >= 0, guarantees that all sessions found in the
Store will be loaded on startup.
maxIdleBackup: Sessions will be backed up (saved to the Store,
but left in active memory) if idle for this long (in seconds),
and all sessions found in the Store will be loaded on startup.
If set to -1 sessions will not be backed up, 0 means they
should be backed up shortly after being used.
To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
and minIdleBackup all to -1, saveOnRestart to false, then restart
Catalina.
-->
<!--
<Manager className="org.apache.catalina.session.PersistentManager"
debug="0"
saveOnRestart="true"
maxActiveSessions="-1"
minIdleSwap="-1"
maxIdleSwap="-1"
maxIdleBackup="-1">
<Store className="org.apache.catalina.session.FileStore"/>
</Manager>
-->
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
type="javax.sql.DataSource"/>
<Resource name="jdbc/TestDB"
auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/TestDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!-- MySQL dB username and password for dB connections -->
<parameter>
<name>user</name>
<value>javauser</value>
</parameter>
<parameter>
<name>password</name>
<value>javadude</value>
</parameter>
<!-- Class name for mm.mysql JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
<ResourceLink name="linkToGlobalResource"
global="simpleValue"
type="java.lang.Integer"/>
</Context>
</Host>
</Engine>
</Service>
<!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
as its servlet container. Please read the README.txt file coming with
the WebApp Module distribution on how to build it.
(Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
To configure the Apache side, you must ensure that you have the
"ServerName" and "Port" directives defined in "httpd.conf". Then,
lines like these to the bottom of your "httpd.conf" file:
LoadModule webapp_module libexec/mod_webapp.so
WebAppConnection warpConnection warp localhost:8008
WebAppDeploy examples warpConnection /examples/
The next time you restart Apache (after restarting Tomcat, if needed)
the connection will be established, and all applications you make
visible via "WebAppDeploy" directives can be accessed through Apache.
-->
<!-- Define an Apache-Connector Service -->
<!--
<Service name="Tomcat-Apache">
<Connector className="org.apache.catalina.connector.warp.WarpConnector"
port="8008" minProcessors="5" maxProcessors="75"
enableLookups="true" appBase="webapps"
acceptCount="10" debug="0"/>
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache_log." suffix=".txt"
timestamp="true"/>
<Realm className="org.apache.catalina.realm.MemoryRealm" />
</Engine>
</Service>
-->
</Server>
Pleas4 help!!!you have your driver jar in Tomcat\common\lib?
if so, check your classpath, it could be that. -
Setting up Connection Pool in sun app server 8.1 with SQL server 2000
Hello,
I am trying to set up a connection pool & data source for SQL server 2000 (MSDE 2000).
Here is what I attempted to do:
I have a pool data source in a jar file called poll.jar and I copied it to C:\sun\Appserver\lib (Install dir\lib)
com.microsoft.mspool.PoolDataSource is the pool data source class.
In the Admin console, JDBC>Connection pools. Selected NEW and made the following entries.
GENERAL SETTINGS
Name: MsPool
Datasource class name : com.microsoft.mspool.PoolDataSource
Resource type: javax.sql.DataSource
POOL SETTINGS: default values
CONNECTION VALIDATION: default values
TRANSACTION ISOLATION: default values
PROPERTIES:
DataSourceName:PoolDataSource
NetworkProtocol:tcp
DatabaseName: myDB
Password:User specific
user:User specific
server: localhost
PortNumber:1433
I get the following error when I ping:
Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Class name is wrong or classpath is not set for : com.microsoft.mspool.PoolDataSource.
Can any one help me if have a solution?
Thanks in advance.
magYou need to copy your jar to ${AS_INSTALL}/domains/domain1/lib/ext (replace domain1 by your
domain). Another option is to leave the jar in ${AS_INSTALL}/lib and add a entry in the classpath-suffix element of your domain.xml.
thanks,
:aditya -
Hi there,
I was previously using the jferner/node-oracle module with the "generic-pool" (https://github.com/coopernurse/node-pool) module for connection pooling.
I'm trying out a setup with connection pooling with node-oracledb and have a few questions:
* If an execute call fails with a connection i've retrieved from the pool, and I want to destroy that connection and remove it from the pool, how do I do that? Is it done implicitly for me?
* Is there any way to validate a connection before it's used? Or again, is this done implicitly? Is there a way to toggle it on and off for perf tuning?
* Is there any way to tune how frequently Oracle checks for idle connections? (In generic-pool this was called reapIntervalMillis)
* Is there any way to turn on any logging of how the connection pool behaves for development debugging? I just want to make sure my setup is behaving as I think it should be.
I'm making some good headway on getting the module working and it wasn't too difficult a conversion from node-oracle, either, that's good!
-MattYou should release() bad connections to the pool so the pool can replace them.
Validating connections is generally not worth it: between validation & use there could be a failure, so your executions need to handle errors anyway. Why reduce scalability and performance by doing an extra "round trip" for validation? Also you can use FAN which can proactively clean up idle sessions in the session pool that are affected by the DB instance disappearing (due to network glitches etc).
The client-side pool is handled by Oracle session pooling, so the algorithms are opaque. -
How to use connection pooling in jsp?
I'm new to world of JSP. I'm developing web application using Oracle 8i and JSP to implement it. I'm using jakarta-tomcat server for this purpose.
I'll frequently access the database. so I want to use the connection pooling.
Can anybody explain the simple procedure to use it
thanxHello syyuen,
Please help me, here iam sending u my server.xml , web.xml and servlet
application. I put classes12.jar in tomcat/common/lib. and above servlet
class application under tomcat/webapps/root/web-inf/classes
and this is a simple servlet program for getting connection from the
connection pool of tomcat using tyrex..
my oracle database name is "myuser" and password is "mypass"
either u check my server.xml or tell me where under which tag should i
place <Resource...> tag in server.xml and should i need to modify any
other places..??
server.xml
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<!-- Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<!-- Non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="60000"/>
<!-- AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
<!-- Top level container in our container hierarchy -->
<Engine name="Standalone" defaultHost="localhost" debug="0">
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally
<Realm className="org.apache.catalina.realm.MemoryRealm" /> -->
<!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC -->
<!-- <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority?user=test;password=test"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@oracle:1521:ORCL"
connectionName = "mail"
connectionPassword = "mail"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
<!-- <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!-- Define the default virtual host -->
<Host name="localhost" debug="1" appBase="webapps" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<!-- Tomcat Root Context -->
<!-- <Context path="" docBase="ROOT" debug="0"/> -->
<!-- Tomcat Manager Context -->
<Context path="/manager" docBase="manager" debug="0" privileged="true"/>
<!-- MY CONTEXT HERE -->
<Context path="/localhost" docBase="localhost" debug="0" reloadable="false" override="true">
<Resource name="jdbc/myConnection" auth="SERVLET" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/myConnection">
<parameter><name>user</name><value>myuser</value></parameter>
<parameter><name>password</name><value>mypass</value></parameter>
<parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@oracle:1521:ORCL</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>32</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
</ResourceParams>
<!-- END OF MY Context, Oracle username=myuser,password=mypass -->
<!-- i pasted this context from somebody . should i need whole context or resource name in that...???? -->
<!-- Tomcat Examples Context
<Context path="/examples" docBase="examples" debug="0" reloadable="true" crossContext="true">
-->
<!--
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_examples_log." suffix=".txt" timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity" home="com.wombat.empl.EmployeeRecordHome" remote="com.wombat.empl.EmployeeRecord"/>
<Environment name="maxExemptions" type="java.lang.Integer" value="15"/>
<Parameter name="context.param.name" value="context.param.value" override="false"/>
<Resource name="jdbc/EmployeeAppDb" auth="SERVLET" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/EmployeeAppDb">
<parameter><name>user</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter><name>driverClassName</name><value>org.hsql.jdbcDriver</value></parameter>
<parameter><name>driverName</name><value>jdbc:HypersonicSQL:database</value></parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
-->
</Context>
</Host>
</Engine>
</Service>
<!-- Define an Apache-Connector Service -->
<Service name="Tomcat-Apache">
<Connector className="org.apache.catalina.connector.warp.WarpConnector"
port="8008" minProcessors="5" maxProcessors="75"
enableLookups="true" appBase="webapps"
acceptCount="10" debug="0"/>
<!-- Replace "localhost" with what your Apache "ServerName" is set to -->
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0">
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<Realm className="org.apache.catalina.realm.MemoryRealm" />
</Engine>
</Service>
</Server>
web.xml
<web-app>
<servlet>
<servlet-name>conServlet</servlet-name>
<servlet-class>conServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>conServlet</servlet-name>
<url-pattern> /conServlet </url-pattern>
</servlet-mapping>
<resource-ref>
<description> Resource reference to java.sql.Connection
factory defined in server.xml
</description>
<res-ref-name>jdbc/myConnection</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
servlet application
DataSource ds = (DataSource) new InitialContext().lookup("java:comp/env/jdbc/myConnection");
conn = ds.getConnection();
out.println("conn : " + conn); -
How to dynamically validate users at run time using connection pools ?
Hi Folks
We are facing a peculiar situation . We have established connection to our
oracle 8i database using Oracle Thin driver using conenction pooling at the weblogic
server . We set up connection pools at the console to set up connections to thge
oracle 8i database. However the user name and password is always static when
we create the connection pool at the console .
How do i dynamically validate other users using the same connection pool ??
Eg - The connection pool at design time in the console uses user A and password
- passA . Now at run time lets say I prompt the user for a login screen and want
to trap the user id and apssword parameters entered by the user and use it with
the connection pool created earlier . I tried using the below code snippet :-
Properties props = new Properties();
props.put("connectionPoolID", "Oracle_Thin_Driver_Pool");
props.put("user" , userId );
props.put("password",userPass);
myDriver = (Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
conn = myDriver.connect("jdbc:weblogic:pool", props);
But always it connects to the database using the userid and password set in the
console while creating the connection pool . So how i get the connection pool
to validate my current userid and password entered through the login screen ??
Thanks in advance
KeithHey Bob.
So I assume you're -completely- working with built executables? You're not going to work in the editor environment to modify your projects at all?
If this is the case, then having a generic deployment phase at the beginning of the executable (with a "setting up hardware for your app" splash screen) isn't a bad idea -
Check the binary on the target, ensure it matches the binary you have on the host machine (in case you ever decide to update).
If they don't match, FTP the new file down to replace the old one.
FTP the ni-rt.ini file, ensure the startup exe is enabled and is pointing to the correct location.
If it's not enabled or not pointing to the correct startup file, modify the .INI file and FTP back to the target.
If you had to update the INI file, ask target to reboot itself. Wait 30 seconds, and wait for target to become available again.
Connect to the target. If you cannot connect, reboot target. If the target comes back and you still cannot connect to the app, notify user.
That's almost exactly how we handle installation and deployment via MAX.
The big assumption here is that the built executables were all built with the same version of LabVIEW Real-Time. If not, you'd need a system replication step in there to make sure the proper version of LabVIEW is on the target before launching the built .rtexe.
-Danny -
"Hello,
From reading of these newsgroups I've seen many different manifestations
of what seems to be the same root cause with connection pools and
connections which are refreshed/replaced when found broken. In our
case weblogic server hangs.
Kit: 2xWeblogic 5.1.0 sp11 (not clusterd), Solaris 8,
java 1.3.1_01, 1xoracle 8.1.6, latest JDBC 2.0 drivers from oracle. Each weblogic instance and oracle have their own machines.
We do indeed have a firewall employed to run our subnets, and hence
our weblogic servers and oracle databses are in different DMZ's, but are
allowed to communicate to each other via rules set up on the firewall and
inspection of the logs show no such connections being dropped.
As far as the db is concerned, lookups (no writes) never take more than a few
hundred milliseconds and are then closed and given back to the connection pool
immediately from within the 'finally' block of code, hence hard to see when,if ever, the db is
is closing them due to excessive idle time.
weblogic.jdbc.connectionPool.RecipeDBPool=\
url=jdbc:oracle:thin:@foo:1521:BAA,\
driver=oracle.jdbc.driver.OracleDriver,\
loginDelaySecs=1,\
initialCapacity=30,\
maxCapacity=50,\
capacityIncrement=1,\Alkesh wrote:
Hi Joe,
The fix you suggested has been implemented and has been running fine
now for the past 3 days. I'm delighted with the result,Great. Glad to help.
but am concerned as to why this problem wasnt highlighted during our
load-testing phases...It's a possibility that your load-testing didn't present the same sort
of load that your actual runtime does.
Thanks for your time on this.Well sure. We want you successful.
Joe
Alkesh
At 01:52 PM 2/22/2002 +0000, you wrote:
Hi Joe,
Thanks for your reply
Please find attached a copy of the jvm thread dump we got from thelast time
that weblogic blocked upon trying to refresh a broken connection.
We have turned off JIT with the environment settingJAVA_COMPILER=NONE.
FYI hotspot is enabled with '-hotspot', these settings can be foundin the
attached 'startWeblogic.sh'.Hi. I found a serious problem by reading the thread dump:
"ExecuteThread-11" daemon prio=5 tid=0x179d40 nid=0x19 waiting for
monitor entry
[0xeee80000..0xeee819e0]
at java.sql.DriverManager.getConnection(DriverManager.java:144)
- waiting to lock <f8e77ad0> (a java.lang.Class)
at com.akqa.sainsburys.jv_recipe.ejb.session.RecipeBean.getConnection(Re
cipeBean.java:759)
It is important to never call DriverManager methods in a multithreaded
application
such as Weblogic, because these JVM methods are alloverly synchronized
at
the class level. One such method, DriverManager.println(), is called
continuously
by all JDBC drivers as well as the SQLException constructor. If one
server thread
makes a long-lasting or hanging call to DriverManager.getConnection(),
it can halt
all JDBC in the whole JVM including work on other open driver
connections.
Please show me the code for RecipeBean.java, and I will send you an
altered version
that should solve this problem. In fact, I can infer from the thread
dump what is needed.
Change the one method getConnection() to this:
// Make once and re-use a driver instance directly, avoiding
DriverManager
Driver d = (Driver)class.forName("weblogic.jdbc.jts.Driver").newInstance();
public Connection getConnection()
return d.connect("jdbc:weblogic:jts:yourPoolNameHere", null );
Also, change your pool definition. I assume you have
testConnsOnReserve set to true.
(You should). Also, you should change your refresh minutes to
something huge, like
9999999. The refresh is interfering with your online performance and
is unnecessary
if you have testConnsOnReserve set. I recommend:
weblogic.jdbc.connectionPool.RecipeDBPool=\
url=jdbc:oracle:thin:@foo:1521:BAA,\
driver=oracle.jdbc.driver.OracleDriver,\
loginDelaySecs=1,\
initialCapacity=50,\ <------ note that this should be the
same as max, so all cons are made at startup
maxCapacity=50,\
testTable=dual,\
testConnsOnReserve=true,\
refreshTestMinutes=9999999,\
etc.
Joe
I've also attached some firewall logs around the time of weblogicblocking
(12.09). I could only get screen dumps for you, this may or maynot be
useful.
For the firewall logs use the following legend :-
195.110.64.205 - DNS
172.16.160.195 - host webserver 1 (i.e. what our licenses are boundto)
172.16.160.196 - host webserver 2
172.16.160.220 - website 1
172.16.160.230 - website 2
Thanks
Alkesh
-----Original Message-----
From: Joe [mailto:[email protected]]
Sent: 20 February 2002 22:09
To: [email protected]
Subject: Re: 5.1.0 sp11 Connection pool refresh issue,
revisited....again...!!!
At 02:47 PM 2/20/2002 +0000, you wrote:
Hi Joe,
Please find attached a copy of our thread dumps for the most recentoccasion
that weblogic server has stopped.
Apologies for any misunderstandings with my previous post, it appears to
have been cropped. Full posting below (yes we do have testConnOnReserve and
testTable properties set).
Thanks for your time.sure, but first let's get you running OK. These dumps seem to be
very cryptic, as if you're running a highly optimized JVM that
loses almost all of the Java class references I'd normally see.
Can you run again with a more basic JVM? I am beginning to suspect
the JIT JVM...
Joe
Alkesh
Joseph Weinstein wrote:
Hello,
From reading of these newsgroups I've seen many
different manifestations of what seems to be the sameroot cause with connection pools and connections
which are refreshed/replaced when found broken. In our
case weblogic server hangs.
Kit: Weblogic 5.1.0 sp11 (not clusterd),
Solaris 8, java 1.3.1_01, oracle 8.1.6,
latest JDBC 2.0 drivers from oracle.
We do indeed have a firewall employed to run our subnets,
and hence our weblogic servers and oracle databses are
in different DMZ's, but are allowed to communicate to each
other via rules set up on the firewall and inspection of
the logs show no such connections being dropped.
As far as the db is concerned, lookups (no writes) never
take more than a few hundred milliseconds and are then
closed and given back to the connection pool immediately
from within the 'finally' block of code, hence hard to
see when,if ever, the db is is closing them due to excessive idle time.
weblogic.jdbc.connectionPool.RecipeDBPool=\
url=jdbc:oracle:thin:@foo:1521:BAA,\
driver=oracle.jdbc.driver.OracleDriver,\
loginDelaySecs=1,\
initialCapacity=30,\
maxCapacity=50,\
capacityIncrement=1,\
allowShrinking=false,\
testTable=dual,\
testConnsOnReserve=true,\
shrinkPeriodMins=1,\
refreshTestMinutes=10,\ // has been 1 and 5 but 10 'more' stable.
Fequently however, connections are found to be broken
(either by periodical refresh - refreshTestMinutes or
testing connection before granting it to the
application - testConnsOnReserve=true), this has been
confirmed by viewing JDBC.log .
When this is so, weblogic attempts to replace these
broken connections with new ones and then proceeds
to grant it to the application. Once in a while however
(and by no means 'x' refreshes later), weblogic will not
come back.
One of 2 errors occur in our deployment which cuase weblogic
to refresh a connection.
<JDBC Pool RecipeDBPool> java.sql.SQLException: No more data to read fromsocket
and
<JDBC Pool RecipeDBPool> java.sql.SQLException: Io exception: Broken pipe
I believe these settings to all be correct, JDBC drivers
in the correct point BEFORE weblogic.aux in classpath, yet
still have the issue of broken connections.
Any ideas ? I've been reading a lot into this probelm
on various postings now, and i'm completely stumped.
Thanks for your time.
Alkesh -
DataSource Connection Pooling in 903?
We are having difficulty getting 9iAS DataSource Pooling to work. We are using 9iAS 9.0.3 (without Infrastructure) and, as per the J2EE Services Guide, have :
1) Added...
Context ic = new InitialContext();
DataSource ds (DataSource) ic.lookup("jdbc/OracleDS")
Connection con = ds.getConnection();
...to our code.
2) Modified the default DataSource's url, username, password, min-connections & max-connections from within Enterprise Manager (leaving ejb-location as is at "jdbc/OracleDS") and restarted the Instance.
The app generates an exception when trying to locate the OracleDS, however.
We have also tried replacing the "com.evermind.sql.DriverManagerDataSource" class with "oracle.jdbc.pool.OracleConnectionCacheImpl" as per another post's recommendation.
It appears that others have had similar problems (prior to 903?), but many have, in fact, (now) got this working successfully -- what are we missing please......?
Thanks.Hi people!
I have a question on the above code.
I tried it myself on OC4j 9.0.3 (the one that comes with JDeveloper) and I noticed the connections on the pool. The problem is the behaviour of this code when the datasource is configured to have as a "max_connections" attribute a value less than 10, e.g. 8.
I tried a datasource of the following form
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
location="jdbc/OracleCoreDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="myuser"
password="mypass"
min-connections="2"
max-connections="8"
url="jdbc:oracle:thin:@localhost:1521:orcl"
inactivity-timeout="60">
<property name="cacheScheme" value="DYNAMIC_SCHEME"/>
</data-source>
but the execution of the code stops when it comes to get a Statement object out of the 9th connection object. Isn't the pool supposed to give a new connection and remove it when it's finished with it? After all, the documentation says that this is the default behaviour of the pool (it is not necessary to declare the DYNAMIC_SCHEME in the data-source.xml)
I am interested in this, because I have a bunch of JSP files (100 of them or even more) that shall use the same connection pool. If some of them are being executed concurrently, then there will definitely be a problem with the available connection objects.
Thanx -
Cannot create connection pool with weblogic jDriver XA for oracle
Hi everybody,
we have serious problems configuring the weblogic jDriver for Oracle with support
for distributed transactions.
Everything works fine with the non-XA driver.
We tried the suggestions given here before like setting the environment variable
ORACLE_SID. However, this does not change the errors we get. We use Weblgic Server
6.1 SP2 with oracle 8.1.7 (client and server) under Windows NT.
When attempting to create the connection pool, we get the following exception:
Starting Loading jDriver/Oracle .....
<14.05.2002 15:48:30 CEST> <Error> <JDBC> <Cannot startup connection pool "DiplPool"
weblogic.common.ResourceException: java.sql.SQLException: open failed for XAResource
'DiplPool' with error XAER_RMERR : A resource manager error has occured in the transaction
branch. Check Oracle XA trace file(s) (if any) for database errors. The Oracle XA
trace file(s) are located at the directory where you start the Weblogic Server, and
have names like xa_<pool_name><MMDDYYYY>.trc.
at weblogic.jdbc.oci.xa.XAConnection.<init>(XAConnection.java:58)
at weblogic.jdbc.oci.xa.XADataSource.getXAConnection(XADataSource.java:601)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection(XAConnectionEnvFactory.java:200)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.createResource(XAConnectionEnvFactory.java:57)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator.java:698)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:623)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
The trace file looks like this:
ORACLE XA: Version 8.1.5.0.0. RM name = 'Oracle_XA'.
113105.161:160.160.-1344514975:
xaoopen: xa_info=Oracle_XA+Acc=P/schamper/schamper+SesTm=100+DB=DiplPool+Threads=true+LogDir=.+DbgFl=0x15,rmid=-1344514975,flags=0x0
113105.161:160.160.-1344514975:
ORA-12560: TNS: Fehler bei Protokolladapter
113105.161:160.160.-1344514975:
xaolgn_help: XAER_RMERR; OCIServerAttach failed. ORA-12560.
113105.161:160.160.-1344514975:
xaoopen: return -3
We suspect that we do not set the properties of the connection pool correctly. The
declaration of the pool in config.xml looks something like the following:
<JDBCConnectionPool CapacityIncrement="1" DriverName="weblogic.jdbc.oci.xa.XADataSource"
InitialCapacity="10" MaxCapacity="15" Name="DiplPool"
Properties="user=scott;password=tiger;url=jdbc:weblogic:oracle:srlaptop_aidenbach.muc.sdm-research.de;dataSourceName=DiplPool"
Targets="Marvin" TestTableName="privcust" URL="jdbc:weblogic:oracle:srlaptop_aidenbach.muc.sdm-research.de"/>
Are there any known issues with the XA driver and the versions of oracle and Weblogic
we use? Can someone tell us how exactly we have to define the connection pool or
provide an example?
Any help would be greatly appreciated.
Best regards,
MichaelHi Michael
Here is an example connection pool tag,
<JDBCConnectionPool
Name="oraXAPool"
Targets="myserver"
DriverName="weblogic.jdbc.oci.xa.XADataSource"
InitialCapacity="1"
MaxCapacity="10"
CapacityIncrement="2"
Properties="user=scott;password=tiger;server=ORCL"
/>
Ensure that the server=ORCL is replaced by server=<what ever the Alias is
defined in TNSNAMES.ORA file>
You dont have to specify the URL for this.
hth
sree
"Michael Wufka" <[email protected]> wrote in message
news:[email protected]...
>
Hi everybody,
we have serious problems configuring the weblogic jDriver for Oracle withsupport
for distributed transactions.
Everything works fine with the non-XA driver.
We tried the suggestions given here before like setting the environmentvariable
ORACLE_SID. However, this does not change the errors we get. We useWeblgic Server
6.1 SP2 with oracle 8.1.7 (client and server) under Windows NT.
When attempting to create the connection pool, we get the followingexception:
Starting Loading jDriver/Oracle .....
<14.05.2002 15:48:30 CEST> <Error> <JDBC> <Cannot startup connection pool"DiplPool"
weblogic.common.ResourceException: java.sql.SQLException: open failed forXAResource
'DiplPool' with error XAER_RMERR : A resource manager error has occured inthe transaction
branch. Check Oracle XA trace file(s) (if any) for database errors. TheOracle XA
trace file(s) are located at the directory where you start the WeblogicServer, and
have names like xa_<pool_name><MMDDYYYY>.trc.
at weblogic.jdbc.oci.xa.XAConnection.<init>(XAConnection.java:58)
atweblogic.jdbc.oci.xa.XADataSource.getXAConnection(XADataSource.java:601)
atweblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection(XAConnec
tionEnvFactory.java:200)
atweblogic.jdbc.common.internal.XAConnectionEnvFactory.createResource(XAConnec
tionEnvFactory.java:57)
atweblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator.j
ava:698)
atweblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java:282
atweblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:623
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
atweblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentT
arget.java:329)
The trace file looks like this:
ORACLE XA: Version 8.1.5.0.0. RM name = 'Oracle_XA'.
113105.161:160.160.-1344514975:
xaoopen:xa_info=Oracle_XA+Acc=P/schamper/schamper+SesTm=100+DB=DiplPool+Threads=true
LogDir=.DbgFl=0x15,rmid=-1344514975,flags=0x0
113105.161:160.160.-1344514975:
ORA-12560: TNS: Fehler bei Protokolladapter
113105.161:160.160.-1344514975:
xaolgn_help: XAER_RMERR; OCIServerAttach failed. ORA-12560.
113105.161:160.160.-1344514975:
xaoopen: return -3
We suspect that we do not set the properties of the connection poolcorrectly. The
declaration of the pool in config.xml looks something like the following:
<JDBCConnectionPool CapacityIncrement="1"DriverName="weblogic.jdbc.oci.xa.XADataSource"
InitialCapacity="10" MaxCapacity="15" Name="DiplPool"
Properties="user=scott;password=tiger;url=jdbc:weblogic:oracle:srlaptop_aide
nbach.muc.sdm-research.de;dataSourceName=DiplPool"
Targets="Marvin" TestTableName="privcust"URL="jdbc:weblogic:oracle:srlaptop_aidenbach.muc.sdm-research.de"/>
>
Are there any known issues with the XA driver and the versions of oracleand Weblogic
we use? Can someone tell us how exactly we have to define the connectionpool or
provide an example?
Any help would be greatly appreciated.
Best regards,
Michael -
Help Please: How to make a connection pool with mySQL
Hi,
I am learning the example codes shipped with weblogic server, which is under ...samples\examples\ejb20\basic\beanManaged. The original connection pool was on cloudscape. I was trying to modify it and make it connect to mySQL.
In ejb-jar.xml and weblogic-ejb-jar.xml, I replaced "demopool" (which was the original pool name) with "demopool1".
After starting the server, I tried to configure a new connection pool as following:
Name: demopool1
URL: jdbc:mysql:///test
Driver Classname: org.gjt.mm.mysql.Driver
Properties
(key=value): user=none
server=none
But I got the following errors:
<2007-10-5 ??06?30?09?> <Error> <JDBC> <Cannot startup connection pool "demopool1" Cannot load driver class: org.gjt.mm.mysql.Driver>
What should I do to let the server find the Driver?
Thanks a lot.Hong Qu wrote:
Thank you Joe,
I added the jar file location to the startExampleServer script. But when I tried to configure the Tx Data Sources from the console, I got the following error:
<2007-10-5 ??08?35?17?> <Notice> <WebLogicServer> <Started WebLogic Admin Server "examplesServer" for domain "examples" running in Development Mode>
setEntityContext called
ejbFindByPrimaryKey (ID: 0)
Failed to lookup JDBC Datasource. Please double check that
the JNDI name defined in the resource-description of the
EJB's weblogic-ejb-jar.xml file is the same as the JNDI name
for the Datasource defined in your config.xml.
<2007-10-5 ??08?38?16?> <Error> <JDBC> <Error during Data Source creation:
weblogic.common.ResourceException: DataSource(examples-dataSource-demoPool1)
can't be created with non-existent Pool (connection or multi) (demoPool1)>>
Do you know where is wrong?
Another problem is the connection method in AccountBean.java:
private Connection getConnection()
throws SQLException
InitialContext initCtx = null;
try {
initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("java:comp/env/jdbc/demoPool");First verify from the console that a pool 'demoPool1' exists and
that you can test it from the console. Then find the DataSource
you associated with that pool. For an EJB I would suggest a
TxDataSource. You defined some JNDI name for the DataSource. Use
that name in the lookup. For instance, if your DataSource's
JNDI name is 'MyDataSource', the code should do this:
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("MyDataSource");
return ds.getConnection();
} catch(NamingException ne) {
log("Failed to lookup JDBC Datasource. Please double check that");
log("the JNDI name defined in the resource-description of the ");
log("EJB's weblogic-ejb-jar.xml file is the same as the JNDI name ");
log("for the Datasource defined in your config.xml.");
throw new EJBException(ne);
} finally {
try {
if(initCtx != null) initCtx.close();
} catch(NamingException ne) {
log("Error closing context: " + ne);
throw new EJBException(ne);
I couldn't figure out what "java:comp/env/jdbc/demoPool" was related, so I just replaced "demopool" with "demopool1". Do you konw what "comp/env/jdbc" mean? Is it a location?
Thank you so much.
Iris -
RFC_FAILURE affects Connection Pool
Using VB.NET (2003) with .Net Connector 2.0.
An intermittent problem causes a RFC Call to fail, and an exception is raised in the .NET code. The Exception message is:
See RFC trace file or SAP system log for more details
The Trace file shows:
ERROR file opened at 20051115 131423 GMT Standard
T, SAP-REL 640,0,78 RFC-VER 3 759904 MT-SL
<b>T:2844 Could not send rfc container 0x130
T:2844 <* RfcCall [1] : returns 1:RFC_FAILURE
T:2844 <* RfcCallReceive [1] : returns 1:RFC_FAILURE
>TS> Tue Nov 15 13:14:24 2005
T:2844 <* RfcCleanupContext [1] : returns
18:RFC_INVALID_HANDLE
T:2844 <* RfcCleanupContext [1] : returns
18:RFC_INVALID_HANDLE</b>
This error adversely affects the Connection Pool as calls to other RFCs are now prone to similar intermittent errors
Is there any way to prevent the problem causing problems with Connection Pool ?
Is there any way of removing a faulty connection from the pool ? (NB Close and Dispose on the connection does not help)The application is a Windows service - so I don't want to lose any connections. I assume that closing the connection (and not returning it) will affect the number of available connections in the pool(?).
I'm using async. RFC call, and the problem is detected in the callback function when the EndRFCCall is performed.
Original code:
Public Sub Execute_RFC(ByVal parameters as string())
' Assign SAP Connection to RFC Proxy
sapRFCProxy.Connection = SAPConnectionPool.GetConnectionFromPool(<i>ConnectString</i>)
Call the SAP RFC - Asynchronously
arAsyncResult = m_sapRFCProxy.BeginRFCCall( params..., AddressOf RFC_CallBack, objAsyncState)
End Sub
Private Sub RFC_CallBack(ByVal ar As IAsyncResult)
Try
' Retrieve the SAP RFC Response...
Call sapRFCProxy.EndRFCCall(ar, <i>param1, param2, etc...</i>)
Catch ex As Exception
' Log the Error...
End Try
' Return the Connection
Call SAPConnections.ReturnConnection(sapRFCProxy.Connection)
End Sub
I have changed the code as suggest so that the connection is closed, disposed but <u>not</u> returned. This cleared the RFC_INVALID_HANDLE errors, but the main problem of a corrupted connection persists.
Diagnostics produced by the amended code:
<u>Trace File (Info):</u>
2005-11-16 11:55:46Z Warning: RfcCleanupContext failed. Closing connection
<u>dev_RFC.trc</u>
ERROR file opened at 20051116 115546 GMT Standard T, SAP-REL 640,0,78 RFC-VER 3 759904 MT-SL
T:3068 ======> CPIC-CALL: 'CMSEND'
ERROR program state check for conversation 99610798
TIME Wed Nov 16 11:55:46 2005
RELEASE 640
COMPONENT CPIC (TCP/IP)
VERSION 3
RC 471
MODULE r3cpic.c
LINE 2576
DETAIL called function STSEND in state state=BUFFER_DATA2
COUNTER 1
T:3068 <* RfcCall [20] : returns 1:RFC_FAILURE
T:3068 <* RfcCallReceive [20] : returns 1:RFC_FAILURE
T:3068 <* RfcCleanupContext [20] : returns 1:RFC_FAILURE
Even with the change to the code, a call to a reliable RFC will now fail <u>intermittently</u> with:
T:2876 Could not send rfc container 0x130
T:2876 <* RfcCall [24] : returns 1:RFC_FAILURE
T:2876 <* RfcCallReceive [24] : returns 1:RFC_FAILURE
Thanks -
Connection pool / db failure
WLS6.0 sp2 / Win2k
Oracle 8.1.7 / Solaris 8
problem is if DB fails, the connection pool fails, and will not restart. If I run a java weblogic.Admin EXISTS_POOL command, it says the pool doesnt exist.
If i run a RESET_POOL, using the system user password, it comes back with:
Exception in thread "main" javax.naming.AuthenticationException. Root exception is java.lang.Securi
tyException: Authentication for user guest denied in realm weblogic
<<no stack trace available>>
I have test on reserved set (and dual as the table).
Anyone shed any light on what could be going wrong, because right now, every time the DB fails, we have to restart the **&$"&^ server.... (and that takes around 20mins for all the apps to init)
tks
willHi Will,
When you bring up the server, if the database is down, your connection pools
will not come up if you have an initial capacity greater than 0. This is a
known issue and the workaround for this is to set the initial capacity to
zero so the pool comes up even when the database is down, then make sure you
set the capacity increment to the value that you like your initial capacity
to be and have the TestConnectionOnReserve to true.
hth
sree
"Will" <[email protected]> wrote in message
news:3d13111f$[email protected]..
WLS6.0 sp2 / Win2k
Oracle 8.1.7 / Solaris 8
problem is if DB fails, the connection pool fails, and will not restart.If I run a java weblogic.Admin EXISTS_POOL command, it says the pool doesnt
exist.
If i run a RESET_POOL, using the system user password, it comes back with:
Exception in thread "main" javax.naming.AuthenticationException. Rootexception is java.lang.Securi
tyException: Authentication for user guest denied in realm weblogic
<<no stack trace available>>
I have test on reserved set (and dual as the table).
Anyone shed any light on what could be going wrong, because right now,every time the DB fails, we have to restart the **&$"&^ server.... (and that
takes around 20mins for all the apps to init)
>
tks
will
Maybe you are looking for
-
IPhone won't completely delete songs in iTunes (corrupted files?)
Hey guys, I've been working on this issue for nearly two days now, and I just have no idea of how to fix it. The issue: in iTunes, my iPhone says I have multiple albums/songs on the phone, despite me trying multiple times to delete them, and despite
-
Installing old application to OS Windows 7 64-bit
I have OS Windows 7 64-bit on computer and I am trying to download software from Amervets that is a Military Database. The webmaster from that site stated: The War Library military-access software works on ALL versions of Windows from Win 1.0 to the
-
Error using settings with serial port
Hi guys: Can any one please tell me how to I change this line as I am getting error on Settings in VB.NET Thanks 'Me.Settings = frmWeightMain.SerialPort1.Settings 'Error Me.CommPort = frmWeightMain.SerialPort1.PortName
-
I have my laptop turned on when I put it in the port replicator. How do I get it to not hibernate so I can use the PR? Thanks!
-
Hi Friends, Can any one help me to get the details of the employee, earning the SECOND maximum salary in a particular department, using SQL. The table structure is similar to this: Table Name: Employees Columns: Empno,Ename,Salary,Department... Thank