Skip to content

XAware Community

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
XAware 5.6
Need Help
Webinars and Events
Advanced Tutorials
Webinars and Events

You are here: Home arrow Forums
XAware Community Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:jdbc connection and connection pooling (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 1
TOPIC: Re:jdbc connection and connection pooling
#5980
kilyas (User)
XAware user
Posts: 27
User Offline Click here to see the profile of this user
jdbc connection and connection pooling 9 Years, 11 Months ago Karma: 13  
I am using XAware for my database transactions, using the following driver:-

<?XML version="1.0" encoding="UTF-8"?>
<xa:BizDriver xmlns:xa="http://xaware.org/xas/ns1" xa:bizdrivertype="SQL_JNDI" xa:version="5.2">
<xa:description />
<xa:poolingparams />
<xa:initialContext xa:type="default">
<xa:url>jnp://localhost:1099</xa:url>
<xa:user /
><xa:pwd />
<xa:factory>org.jnp.interfaces.NamingContextFactory</xa:factory>
<xa:properties />
<xa:lookupName>java:TradeTestOracleDS</xa:lookupName>
<xa:userTransactionLookupName>UserTransaction</xa:userTransactionLookupName>
<xa:transactionManagerLookupName />
</xa:initialContext>
</xa:bizDriver>


I am running XAware using JBoss as the container. So far so good. The problem arises when for certain transactions I don't want to use this driver and rather use another one.

<?xml version="1.0" encoding="UTF-8"?>
<xa:bizDriver xmlns:xa="http://xaware.org/xas/ns1" xa:bizdrivertype="SQL_JDBC" xa:version="5.2">
<xa:description />
<xa:poolingparams />
<xa:connection>
<xa:url>jdbc:oracle:thin:@prxxxx.xxxx.com:1521:prodd</xa:url>
<xa:user>$xavar:userName$</xa:user>
<xa:pwd>$xavar:password$</xa:pwd>
<xa:factory>oracle.jdbc.driver.OracleDriver</xa:factory>
<xa:properties />
</xa:connection>
<xa:designer>
<xa:wizard_step xa:name="Jars Info">
<JarsInfo />
</xa:wizard_step>
<xa:wizard_step xa:name="Biz Driver" />
</xa:designer>
</xa:bizDriver>


Now what happens is that it seems to work fine for the first user whoever it is and he successfully logs in and does the transaction but as soon as the second user tries to login he gets connection pool errors.

Any suggestions?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5981
kilyas (User)
XAware user
Posts: 27
User Offline Click here to see the profile of this user
Re:jdbc connection and connection pooling 9 Years, 11 Months ago Karma: 13  
This is the exact verbage of the error that I get:-

<Error>
  <detail>Error: Error in executing BizComponent [com/ccminvest/securities/xbc/QueryMaxRecordDate.xbc]: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (java.sql.SQLException: ORA-01017: invalid username/password; logon denied ) at /sql (com/ccminvest/securities/xbc/QueryMaxRecordDate.xbc) at /Record_Dates/Element (com/ccminvest/securities/xbd/TestQueryMaxRecordDate.xbd)</detail>
  </Error>
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5991
prichards (Admin)
Admin
Posts: 319
User Offline Click here to see the profile of this user
Re:jdbc connection and connection pooling 9 Years, 11 Months ago Karma: 18  
The XAware managed connection (JDBC connection) automatically implements pooling of BizDrivers. The pooling can be managed through the xa:poolingparams (see the Designer Help documentation), but I do not see a way to turn pooling "off". Pooling parameters are configured according to the Apache DBCP model, refer to the documentation at http://commons.apache.org/dbcp/configuration.html . There is some additional info and an example at the following post
Re:com.ibm.db2.jcc.DB2Driver & pooling parms.

In my XAware 5 testing, I was able to make multiple connections with different users, however XAware pools the BizDrivers by name including the BizDriver/user/type (but not the password) - you can see the entries in the pool on the JBoss JMX console. Since the password is not included in the pooled entry, an attempt to connect with the same driver will grab the matching driver from the pool for the last attempt. If a valid connection exists, it will connect (even if the password supplied is different) using the current active connection; which seems to be opposite of the problem you are having. But, it will also fail with the same pooled driver info, if the first attempt had a bad password (even though you supply a good password in the next attempt), which may be the issue you are having.

Typically, our customers are using "static" connection information in XAware managed connections - although it can be parameterized to configure for different environments, and so forth - so that a BizDriver represents a connection to that datasource for a given user/password. (Much like setting up JBoss datasource for a connection.) Security is then usually managed at the BizDoc/BizComp level, through the user/roles authorization, rather than at the database level. This allows better sharing of pooled connections, rather than always creating a new connection for each user.

Currently, I don't see a way to disable the pooling (Engineering will have to review) or "force" a new connection each time. It might be possible to call the same admin BizDoc that clears the pool, but that would have to be called at the application level each time you are done with a driver/request. I was able to manually test this by clearing the pool on the console after each request, and seeing each new request succeed or fail (invalid user/password).
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Community Login

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
Commercial
Free Training
QuickStart Packages
Image 4 Title
Image 5 Title

Visit XAware.com