All Forums Connectivity
lucasm 4 posts Joined 09/11
05 Sep 2011
JDBC driver fails under 32/64bit JVM on 64bit Ubuntu

Has anyone else seen this? Currently if I run up a connection via the JDBC driver under a 64bit JVM of 32bit JVM under a 64bit Ubuntu I get an unexpected hang. Under a 32bit JVM on a 32bit Ubuntu install everything works fine. The really weird thing is if I run the connection thread through strace it appears to be spinning never really connecting.

64bit JVM version:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

32bit JVM version:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

strace result:

stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=116, ...}) = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 11
connect(11, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, 16) = 0
poll([{fd=11, events=POLLOUT}], 1, 0)   = 1 ([{fd=11, revents=POLLOUT}])
sendto(11, "\323D\1\0\0\1\0\0\0\0\0\0\17localhostcop178\nc3i"..., 48, MSG_NOSIGNAL, NULL, 0) = 48
poll([{fd=11, events=POLLIN}], 1, 5000) = 1 ([{fd=11, revents=POLLIN}])
ioctl(11, FIONREAD, [106])              = 0
recvfrom(11, "\323D\201\203\0\1\0\0\0\1\0\0\17localhostcop178\nc3i" ..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, [16]) = 106
close(11)                               = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 11
connect(11, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, 16) = 0
poll([{fd=11, events=POLLOUT}], 1, 0)   = 1 ([{fd=11, revents=POLLOUT}])
sendto(11, "\vm\1\0\0\1\0\0\0\0\0\0\17localhostcop178\10c3h"..., 46, MSG_NOSIGNAL, NULL, 0) = 46
poll([{fd=11, events=POLLIN}], 1, 5000) = 1 ([{fd=11, revents=POLLIN}])
ioctl(11, FIONREAD, [104])              = 0
recvfrom(11, "\vm\201\200\0\1\0\0\0\1\0\0\17localhostcop178\10c3h" ..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, [16]) = 104
close(11)                               = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=116, ...}) = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 11
connect(11, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, 16) = 0
poll([{fd=11, events=POLLOUT}], 1, 0)   = 1 ([{fd=11, revents=POLLOUT}])
sendto(11, "O\243\1\0\0\1\0\0\0\0\0\0\17localhostcop178\nc3i"..., 48, MSG_NOSIGNAL, NULL, 0) = 48
poll([{fd=11, events=POLLIN}], 1, 5000) = 1 ([{fd=11, revents=POLLIN}])
ioctl(11, FIONREAD, [106])              = 0
recvfrom(11, "O\243\201\203\0\1\0\0\0\1\0\0\17localhostcop178\nc3i" ..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, [16]) = 106
close(11)                               = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 11
connect(11, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, 16) = 0
poll([{fd=11, events=POLLOUT}], 1, 0)   = 1 ([{fd=11, revents=POLLOUT}])
sendto(11, "}6\1\0\0\1\0\0\0\0\0\0\17localhostcop178\10c3h"..., 46, MSG_NOSIGNAL, NULL, 0) = 46
poll([{fd=11, events=POLLIN}], 1, 5000) = 1 ([{fd=11, revents=POLLIN}])
ioctl(11, FIONREAD, [167])              = 0
recvfrom(11, "}6\201\200\0\1\0\1\0\3\0\3\17localhostcop178\10c3h" ..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.176.185.22")}, [16]) = 167
close(11)                               = 0
socket(PF_NETLINK, SOCK_RAW, 0)         = 11
bind(11, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(11, {sa_family=AF_NETLINK, pid=11568, groups=00000000}, [12]) = 0
sendto(11, "\24\0\0\0\26\0\1\3\370\243eN\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(11, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0\370\243eN0-\0\0\2\10\ 200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 108
recvmsg(11, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\370\243eN0-\0\0\n\200\ 200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 192
recvmsg(11, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\370\243eN0-\0\0\0\0\0\ 0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(11)                               = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=116, ...}) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 11
fstat(11, {st_mode=S_IFREG|0644, st_size=387, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1e3fdc6000
read(11, "10.95.17.237\tlucas-macbook\t# Add"..., 4096) = 387
read(11, "", 4096)                      = 0
close(11)                               = 0
munmap(0x7f1e3fdc6000, 4096)            = 0

tomnolan 594 posts Joined 01/08
06 Sep 2011

The strace output indicates that you are trying to connect to "localhostcop178". My guess is that the "hang" you are seeing is due to the Teradata JDBC Driver's COP discovery process iterating from cop1 up through cop178 and beyond.

Endless COP discovery iteration can occur if you are using a DNS server that directs you to an advertising page instead of giving you a DNS lookup failure.

Since you are trying to connect to localhost, and there are no COP hostnames for localhost, you should turn off COP discovery by specifying the COP=OFF connection parameter in your Teradata JDBC Driver connection URL.

For example:

jdbc:teradata://localhost/TMODE=ANSI,CHARSET=UTF8,COP=OFF

 

lucasm 4 posts Joined 09/11
06 Sep 2011

Hi Tom, that worked perfectly thanks :)

This would explain why when I tried it inside a VM it worked. I initially suspected it was a VM issue due to another developer being able to connect successfully and the only difference we could see was his machine is 32bit while mine is 64bit. I'm going to take a wild guess and say his machine isn't configured to use the same DNS server as mine so his went through fine. Also the 32bit VM that worked was never configured it to use the internal DNS servers.

lucasm 4 posts Joined 09/11
06 Sep 2011

Also is there any documentation as to what the COP process is? Is it similar to a DSN entry for ODBC?

tomnolan 594 posts Joined 01/08
07 Sep 2011

The documentation for the Teradata JDBC Driver's COP discovery feature is available here:

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_2.html#BABJIHBJ

The connection URL parameter is described, and there is a section titled "COP Discovery".

 

You must sign in to leave a comment.