-
1. Re: DataSource.getConnection(String username, String password) polluting datasource?
nickarls Apr 3, 2012 7:03 AM (in response to nickarls)Eyeing through the code it looks like there is a concept of ReauthEnabled on the BaseWrapperManagedConnectionFactory and if that one is false (as per default), the current properties are checked against the ones in the connection and if mismatch, kaboom?
Related to this, perhaps? https://community.jboss.org/wiki/Reauthentication
-
2. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 3, 2012 7:12 AM (in response to nickarls)Nicklas, I'll take a look once I have a moment.
-
3. Re: DataSource.getConnection(String username, String password) polluting datasource?
nickarls Apr 4, 2012 12:00 PM (in response to jesper.pedersen)It would be handy if the connection would return to the original, data-source-defined credentials upon close/return to the pool.
-
4. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 4, 2012 2:31 PM (in response to nickarls)Are you on AS7 7.1.1 ?
-
5. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 4, 2012 2:44 PM (in response to nickarls)And what is your datasource definition where you are seeing this ?
-
6. Re: DataSource.getConnection(String username, String password) polluting datasource?
nickarls Apr 5, 2012 1:48 AM (in response to jesper.pedersen)I'm on upstream master (from yesterday or so)
The trace is
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000456: Unchecked throwable in ManagedConnection.getConnection() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@7f81df5e[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@1220990a connection handles=0 lastUse=1333604337614 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@5f045ffa pool internal context=SemaphoreArrayListManagedConnectionPool@1a1f68d2[pool=OSTiDataSource] xaResource=LocalXAResourceImpl@41ac064[connectionListener=7f81df5e connectionManager=1eb2f376 warned=false currentXid=null] txSync=null] at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:137) at my.DBUtil.getConnection(DBUtil.java:114) ... 21 more Caused by: javax.resource.ResourceException: IJ000456: Unchecked throwable in ManagedConnection.getConnection() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@7f81df5e[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@1220990a connection handles=0 lastUse=1333604337614 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@5f045ffa pool internal context=SemaphoreArrayListManagedConnectionPool@1a1f68d2[pool=OSTiDataSource] xaResource=LocalXAResourceImpl@41ac064[connectionListener=7f81df5e connectionManager=1eb2f376 warned=false currentXid=null] txSync=null] at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:487) at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129) ... 22 more Caused by: javax.resource.ResourceException: Wrong credentials passed to getConnection! at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.checkIdentity(BaseWrapperManagedConnection.java:795) at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.getConnection(BaseWrapperManagedConnection.java:409) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:473) ... 23 more
the DS config is
<datasource jndi-name="java:jboss/datasources/MyDataSource" pool-name="MyDataSource" enabled="true"> <connection-url>jdbc:oracle:thin:@host:1521:db</connection-url> <driver>oracle</driver> <new-connection-sql>ALTER SESSION SET NLS_NUMERIC_CHARACTERS='.,'</new-connection-sql> <pool> <min-pool-size>2</min-pool-size> <max-pool-size>2</max-pool-size> <prefill>true</prefill> <use-strict-min>true</use-strict-min> <flush-strategy>EntirePool</flush-strategy> </pool> <security> <user-name>me</user-name> <password>me</password> </security> <validation> <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/> <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/> <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/> </validation> <timeout> <idle-timeout-minutes>10</idle-timeout-minutes> </timeout> </datasource>
(lowered the pool size so I would be sure to get more mixed up credentials)
I'm also seeing stuff like
08:36:42 /:@ WARN IJ000612: Destroying connection that could not be successfully matched: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@3bf73da7[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@12d6f747 connection handles=0 lastUse=1333604171394 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@5f045ffa pool internal context=SemaphoreArrayListManagedConnectionPool@183946d2[pool=OSTiDataSource] xaResource=LocalXAResourceImpl@5858916a[connectionListener=3bf73da7 connectionManager=1eb2f376 warned=false currentXid=null] txSync=null] 08:36:42 /:@ WARN IJ000612: Destroying connection that could not be successfully matched: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@21cfeaeb[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@5947fba4 connection handles=0 lastUse=1333604169481 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@5f045ffa pool internal context=SemaphoreArrayListManagedConnectionPool@183946d2[pool=OSTiDataSource] xaResource=LocalXAResourceImpl@4d9f9c7[connectionListener=21cfeaeb connectionManager=1eb2f376 warned=false currentXid=null] txSync=null]
(and probably unrelated, some low-level read timeouts on a DB connection that should be network-wise just fine)
Caused by: java.sql.SQLRecoverableException: IO Error: Socket read timed out at oracle.jdbc.driver.T4CPreparedStatement.fetch(T4CPreparedStatement.java:1093) at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:359) at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:263) at org.jboss.jca.adapters.jdbc.WrappedResultSet.next(WrappedResultSet.java:1862) at fi.affecto.webmarela.excel.muodostaja.ExcelTietokanta.haeSarakemäärittelyt(ExcelTietokanta.java:267) [classes:] ... 3 more Caused by: oracle.net.ns.NetException: Socket read timed out at oracle.net.ns.Packet.receive(Packet.java:321) at oracle.net.ns.DataPacket.receive(DataPacket.java:103) at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:230) at oracle.net.ns.NetInputStream.read(NetInputStream.java:175)
-
7. Re: DataSource.getConnection(String username, String password) polluting datasource?
nickarls Apr 5, 2012 2:29 AM (in response to nickarls)(OK the network issue was, surprise, surprise, network-related. Switched to another interface and it appears to have gone away)
Reading on, the matching-warning comes from the fact that the credentials changed between checkin and checkout from the pool?
-
8. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 5, 2012 2:16 PM (in response to nickarls)Thanks.
While I'm thinking could you try the attached files, and send me the TRACE log from org.jboss.jca ?
-
ironjacamar-jdbc.jar 196.3 KB
-
ironjacamar-deployers-common.jar 53.6 KB
-
-
9. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 5, 2012 11:59 AM (in response to jesper.pedersen)Nah, I'm not gonna do it this way for sure...
-
10. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 5, 2012 2:17 PM (in response to nickarls)1 of 1 people found this helpfulCan you try the attached files, and see if they work for you in this scenario -- temp fix for this case only.
-
11. Re: DataSource.getConnection(String username, String password) polluting datasource?
nickarls Apr 11, 2012 2:40 AM (in response to jesper.pedersen)Hey, the easter bunny has been busy while I was away, thanks!
It appears to solve the current issue. What was the approach for this fix and what do you think the final solution will be (should there be a JIRA to track)?
-
12. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 11, 2012 8:45 AM (in response to nickarls)We will fix it with a new datasources subsystem revision which will contain an <allow-multiple-users/> element under the pool definition.
-
13. Re: DataSource.getConnection(String username, String password) polluting datasource?
nickarls Apr 13, 2012 11:37 AM (in response to jesper.pedersen)Was there any JIRA for it so I can keep track on when the workaround is no longer needed?
-
14. Re: DataSource.getConnection(String username, String password) polluting datasource?
jesper.pedersen Apr 13, 2012 11:41 AM (in response to nickarls)"Related issues" ?