Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Driver silently defaults to default DB for user if it fails to connect to another DB

6 views
Skip to first unread message

Martijn Verburg

unread,
Sep 15, 2010, 12:05:49 PM9/15/10
to
Hi all,

Just a bug report really. Using Sybase 12.5.4 ASE and the latest
Jconn driver.

If you create a connection pool to a particular database and the user
cannot connect to the database (isn't a registered user) then there is
no error thrown as the connection then connects to the default DB

Cheers,
Martijn

joe.we...@gmail.com

unread,
Sep 16, 2010, 10:54:59 AM9/16/10
to

Hi. The roots of this issue are in a DBMS inconsistency, and it
has been known for decades. The DBMS behaves differently in
this regard, once a connection is established as opposed to
while it is being established. If you have a working connection
and try to change database context to a bad/disallowed database,
the DBMS returns an error with sufficient numerical severity that
(for instance) a JDBC driver can react to it and throw an exception.
However, during the login/connection establishment process, if the
login request includes that same bad database name, the DBMS
returns a non-severe info-level message, which the driver does not
react to, any more that the classic 'warning' saying the database
context 'changed' to whatever you log in to.
I suppose the driver could have an optional property yo could set,
that tells it to monitor the info messages being returned during
login,
and close the connection and throw an exception if the info says it
couldn't get the requested database.
Joe Weinstein

Martijn Verburg

unread,
Oct 4, 2010, 9:18:44 AM10/4/10
to
Apologies for the late reply, thanks for the extra info! Good to know
it wasn't just me :)

Cheers,
Martijn

On Sep 16, 3:54 pm, "joeNOS...@bea.com" <joe.weinst...@gmail.com>
wrote:

0 new messages