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

Pooled Connection exception

6 views
Skip to first unread message

sybase user

unread,
May 25, 2002, 1:50:27 PM5/25/02
to
My setup is jConnect 5.5, Sybase 11.9.2, JDK 1.3.1_03 and file based JNDI.
Using the combination of

import com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource;
import com.sybase.jdbc2.jdbc.SybDataSource;

for pooled connections. But when I tried to get the connection, I got the
following exception. If I dont "chain" the two DS, I can get Connection via
ConnectionPoolDataSource.getPooledConnection().getConnection() fine.

Please help.
********************
java.sql.SQLException: JZ006: Caught IOException:
java.net.UnknownHostException: null
at
com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:485)
at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:2961)
at com.sybase.jdbc2.tds.Tds.login(Tds.java:339)
at
com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java:213)
at
com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:193)
at
com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:172)
at
com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:124)
at
com.sybase.jdbc2.jdbc.SybDriver.createConnection(SybDriver.java:533)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:473)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:505)
at
com.sybase.jdbc2.jdbc.SybDataSource.getConnection(SybDataSource.java:217)


Lafayette

unread,
May 26, 2002, 1:19:33 AM5/26/02
to
I further checked a few things and here is what I found. It appears what I
set in SybDataSource.setDataSourceName(JNDI_For_Pooled_DS) is ignored and
resulting in the following log, which was produced when I turned on Debug.

Any idea why?

*************
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): serverHost: >null<
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): serverPort: >-1<
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): login: host = 'null',
port = '-1'
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): loading Converter:
com.sybase.jdbc2.utils.PureConverter
com.sybase.jdbc2.timedio.InStreamMgr(Thread[Thread-0,5,main]): Connecting to
'null:-1', timeout = 0ms
(Thread[Thread-0,5,main]): Dbio.connect - new RawDbio
com.sybase.jdbc2.timedio.RawDbio(Thread[Thread-0,5,main]): new RawDbio
com.sybase.jdbc2.timedio.RawDbio(Thread[Thread-0,5,main]): attempting
connection to null:-1, retry # 0
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]):
java.net.UnknownHostException: null
java.net.UnknownHostException: null
at java.net.InetAddress.getAllByName0(InetAddress.java:566)
at java.net.InetAddress.getAllByName0(InetAddress.java:535)
at java.net.InetAddress.getByName(InetAddress.java:444)
at java.net.Socket.<init>(Socket.java:95)
at com.sybase.jdbc2.timedio.RawDbio.doConnect(RawDbio.java:88)
at com.sybase.jdbc2.timedio.InStreamMgr.<init>(InStreamMgr.java:94)
at com.sybase.jdbc2.tds.Tds.login(Tds.java:307)


at com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java:213)
at
com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:193)
at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:172)
at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:124)
at com.sybase.jdbc2.jdbc.SybDriver.createConnection(SybDriver.java:533)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:473)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:505)
at

com.sybase.jdbc2.jdbc.SybDataSource.getConnection(SybDataSource.java:249)


"sybase user" <bys...@hotmail.com> wrote in message
news:VUxgpZB...@forums.sybase.com...

lance.a...@sun.com

unread,
May 28, 2002, 11:53:16 AM5/28/02
to
Are you sure you have registered your pooled DataSource correctly?

set example 11-3 and 11-4 from the JDBC 3.0 spec for a good
overview.

Lafayette

unread,
May 29, 2002, 2:46:46 AM5/29/02
to
Well, the binding apparently works when I did a lookup for the
ConnectionPoolDataSource. It was also OK when I subsequently made
getPooledConnection().getConnection() calls. But these are new connections
obviously.

The problem appears to be SybDataSource, which I was guessing is some sort
of PooledDataSource so I made a binding of that, with the previously binded
ConnectionPoolDataSource as the datasource this time. It looked like
SybDataSource is not a PooledDataSource therefore it doesn't know how to use
the supplied datasource via JNDI. Perhaps Sybase expects the user to
implement our own pooling by using the hooks in ConnectionPoolDataSource?

<lance.a...@sun.com> wrote in message
news:E01640D43EF8D1A50057466485256BC7.00554CC085256BC7@webforums...

Bill

unread,
May 30, 2002, 2:15:29 PM5/30/02
to
Marc,
If I understand the spec correctly, the impl of ConnectionPoolDataSource only
gives you the hook (listenner). But the actually pooling, such as caching, etc,
should implement DataSource, thus the need for the "chaining".

Are you saying that, by getting
SybConnectionPoolDataSource.getPooledConnection().getConnection(), one would get
a Connection from an internally managed pool? I could be wrong but my tests
indicate they are new connections, which seems to be consistent with the spec as
well.

Thanks.

On Thu, 30 May 2002 10:36:13 -0400,
in sybase.public.jconnect50
Marc Zampetti <zamp...@aol.com> wrote:

>I think your problem is that you are using the SybDataSource instead of
>using SybConnectionPoolDataSource. If you want to get connection
>pooling, when use the SybConnectionPoolDataSource. Your previous post
>about "chaining" the two DataSource implementations doesn't make sense
>to me. The SybDataSource is Sybase's implementation of the DataSource
>interface, and SybConnectionPoolDataSource is the implementation of the
>ConnectionPoolDataSource. You use one or the other, not both.
>
>Marc Zampetti
>

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

Marc Zampetti

unread,
May 30, 2002, 5:11:50 PM5/30/02
to

My understanding is that the SybConnectionPoolDataSource implements a
pooling DataSource. So, all you need to do is call getConnection() from
SybConnectionPoolDataSource, and it will automatically come from the pool.
However, I haven't played with this much, and I definitely haven't gone
over the spec very well, so I could be wrong here. When I get a chance,
I will play with it some more.

I know that for Jaguar, when you setup a web app to use connection
pooling, you set the connection cache to use the
SybConnectionPoolDataSource, which is partly why I think what I do.

Marc

Marc Zampetti

unread,
May 30, 2002, 10:36:13 AM5/30/02
to

I think your problem is that you are using the SybDataSource instead of

Bill

unread,
May 31, 2002, 12:10:03 AM5/31/02
to
I think it is easy to get mislead by the name PooledConnection when it
really is just PoolableConnection. On top of that, Sybase's documentation
doesn't help. Time wasted on sybase...

"Marc Zampetti" <zamp...@aol.com> wrote in message
news:3CF69596...@aol.com...

0 new messages