[Datasource Configuration] - When and why does JBoss open more database connections than the maximum requested?
by Glauber Ribeiro
Glauber Ribeiro [http://community.jboss.org/people/theglauber] created the discussion
"When and why does JBoss open more database connections than the maximum requested?"
To view the discussion, visit: http://community.jboss.org/message/573910#573910
--------------------------------------------------------------
I have a data source configured like this:
<datasources>
<ha-local-tx-datasource>
<datasources>
<ha-local-tx-datasource>
...
<min-pool-size>25</min-pool-size>
<max-pool-size>30</max-pool-size>
<validate-on-match>true</validate-on-match>
<background-validation>true</background-validation>
<background-validation-minutes>17</background-validation-minutes>
<prefill>true</prefill>
<set-tx-query-timeout>true</set-tx-query-timeout>
<query-timeout>60</query-timeout>
</ha-local-tx-datasource>
</datasources>
In my interpretation, his should mean:
* start with 25 connections
* grow to 30 if needed
* but not more than 30
I have seen in several occasions the number of open connections go higher than 30. Some times i could correlate this with high activity, but not always. I've heard the number of connections went once to over 100 with no apparent provocation.
Is this a known problem or feature? What triggers it?
JBoss version: [4.3.0.GA_CP03 (build: SVNTag=JBPAPP_4_3_0_GA_CP03 date=200810241616)]
Thank you for any help or ideas.
glauber
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/573910#573910]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months
[Datasource Configuration] - one data source with multiple Oracle database users
by Nicolas Kaczmarski
Nicolas Kaczmarski [http://community.jboss.org/people/pekka_x] created the discussion
"one data source with multiple Oracle database users"
To view the discussion, visit: http://community.jboss.org/message/568176#568176
--------------------------------------------------------------
Dear All,
I have 2 application using 2 differents datasources :
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>TooWsDataSource</jndi-name>
<connection-url>jdbc:oracle:thin:@172.25.225.40:1521:paid</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>Too</user-name>
<password>too</password>
<metadata>
<type-mapping>Oracle10g</type-mapping>
</metadata>
</local-tx-datasource>
<!-- New schema for EPT/WS -->
<local-tx-datasource>
<jndi-name>TooWsDataSourcePt</jndi-name>
<connection-url>jdbc:oracle:thin:@172.25.225.40:1521:paid</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>Too2</user-name>
<password>too</password>
<metadata>
<type-mapping>Oracle10g</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
But when the second application do an sql request the user used is "Too" instead of "Too2".
Have you ideas?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/568176#568176]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months
[Datasource Configuration] - Re: Datasource security
by Nicolas Davyt
Nicolas Davyt [http://community.jboss.org/people/nicolasdavyt1234] created the discussion
"Re: Datasource security"
To view the discussion, visit: http://community.jboss.org/message/574268#574268
--------------------------------------------------------------
Maybe you cant try with define 2 or 3 <jndi-name> with diferent username and password with respective privileges defined at the database. (only select, full acces, etc)
*<local-tx-datasource>
<jndi-name>TradeTestOracle_ONLY_SELECT_DS</jndi-name>
<connection-url>jdbc:oracle:thin:@trmpd_pkg.bankers.com:1521:trmpd</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<max-pool-size>100</max-pool-size>
<user-name>boatradeONLY_SELECT</user-name>
<password>test1</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>*
*<local-tx-datasource>
<jndi-name>TradeTestOracle_ALL_ACCESS_DS</jndi-name>
<connection-url>jdbc:oracle:thin:@trmpd_pkg.bankers.com:1521:trmpd</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<max-pool-size>100</max-pool-size>
<user-name>boatrade**_ALL_ACCESS_**</user-name>
<password>test1</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>*
And in you code like for example: (in your dataBase Connection class.)
public static Connection getConnection( User user)
......
if (user.equals("Bob"))
ds = (DataSource) iniCtx.lookup("*TradeTestOracle_ONLY_SELECT_DS"*);
else if (user.equals("John"))
ds = (DataSource) iniCtx.lookup("*TradeTestOracle_ALL_ACCESS_DS**"*);
.......
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/574268#574268]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months