On Mon, Oct 3, 2011 at 6:52 AM, Greg Thomas <[email protected]> wrote:
> I'm making fairly simply use of the BasicDataSource, something like ...
>
> BasicDataSource ds1 = new BasicDataSource();
> ds1.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
> ds1.setUrl("jdbc:sqlserver://host\\INST01;databaseName=db1");
>
> and everything works just fine.
>
> Until, that is, I try to access another database on the same server.
> If I have another datasource ...
>
> BasicDataSource ds2 = new BasicDataSource();
> ds2.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
> ds2.setUrl("jdbc:sqlserver://host\\INST01;databaseName=db2");
>
> Then both ds1.getConnection() and ds2.getConnection() will return a
> connection to the same database db1 - unless I call
> ds2.getConnection() first, and they both return a connection to db2.
>
> Have I missed something in the usage of a BasicDataSource? Or is
> something more untoward going on here?

Looks odd.  What you are trying to do should work.  Are you sure the
connections are not getting switched somehow?  Please open a JIRA
ticket if not.  A test case attached to the ticket would be great.

Phil
>
> Thanks,
>
> Greg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to