1 Reply Latest reply on Oct 22, 2003 9:57 AM by mgruener

    DataSource.getConnection() and JBoss.

    mhuneycu

      This is a simple question. This is TopLink/JBoss related and is an interesting problem. I have a data source configure called "MyDataSource" with user "A" password "B". I am noticing that the first one to connect using that data source primes the connection pooling for the datasource. So here is the problem:
      If the first guy there does a DataSource.getConnection() then all subsequent calls to DataSource.getConnection("A","B") will fail even though the userid and password passed into the getConnection() are the exact same credentials defined in the mydatasource-ds.xml file. The opposite is also true, if the first one to request a connection from the DataSource does a DataSource.getConnection("A","B") then all subsequent connections using getConnection() fail.

      Unfortunately, TopLink seems to want to issue getConnection(Userid, Password) so I am looking for a solution the will allow me to use both getConnection() and getConnection(userid,password) and have it use the same connection pool if userid and password matches the userid and password in the datasource configured credentials.

      Is this possible. I did explore security byContainer, but with 3.2.1 could not figure out exactly what I needed to do.

      Thanks

        • 1. Re: DataSource.getConnection() and JBoss.
          mgruener

          Can you tell me how to setup a connection pool with Toplink?
          I am using Oracle and have multiple pools setup in my oracle-ds.xml file, which I can access without Toplink as java:/poolName.
          When I try this with Toplink (login.setConnectionString("java:/poolName") or (login.setConnector(new JNDIConnector(context, "java:/poolName") I get an exception saying it is not a compound name.
          It looks like you have gotten past this?