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

JZ006: broken pipe

13 views
Skip to first unread message

Kenneth Rabe

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to
I'm using ASE 12.0 with jConnect 5.2 and have a set of Java classes installed in
the database. When I use one of the static functions of one of my classes I end
up with a broken pipe. However if I immediately precede the call with
a select statement (in this case select 1) everything works as it should. To me
this seems like a hokey work around to be able to make Java stored procedures
work correctly within the database. Since I can successfully use the
select ...'add' from within isql and by executing a select statement immidiately
beforehand, I would appreciate any insight anyone can give. Following is the
code, the exception raised, and the log files for the given run.

Thank you for any help you can provide,
Kenneth Rabe

public void add(StatusMessage added) throws RemoteException {
try {
boolean rc, done;
//Uncomment the following line to work
//dbCon.createStatement().execute("select 1");
String sql = "select com.att.gateway.'database'.";
sql += "StatusMessageProcedures.'add'(?)";
PreparedStatement ps = dbCon.prepareStatement(sql);
ps.setObject(1,added);
rc = ps.execute();
done = false;
// hunt for exceptions
while(!done) {
int i = 1;
if(rc) {
ResultSet rs = ps.getResultSet();
while(rs.next()) {
//If an exception exists, it will be thrown here
Object o = rs.getObject(1);
}
} else {
i = ps.getUpdateCount();
}
rc = ps.getMoreResults();
if(rc == false && i == -1) done = true;
}
} catch(SQLException s) {
throw new RemoteException(s,s);
}
}

After running the above code, when the database connection is next tried the
following exception is thrown:

java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: Broken
pipe
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.sql.SQLException.<init>(SQLException.java:64)
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:423)
at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:2773)
at com.sybase.jdbc2.tds.Tds.language(Tds.java:628)
at com.sybase.jdbc2.jdbc.SybStatement.sendQuery(SybStatement.java:1315)
at
com.sybase.jdbc2.jdbc.SybPreparedStatement.sendQuery(SybPreparedStatement.java:9
07)
at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:1526)
at
com.sybase.jdbc2.jdbc.SybPreparedStatement.execute(SybPreparedStatement.java:511
)
at
com.att.gateway.server.connectionInstance.StatusMessageConnectionInstance.add(Co
mpiled Code)
at
com.att.gateway.server.test.StatusMessageAddTest.basicAdd(StatusMessageAddTest.j
ava:34)
at
com.att.gateway.server.test.StatusMessageAddTest.main(StatusMessageAddTest.java:
21)


And the associated stuff from the log file:

00:00000:00009:2000/06/12 13:00:25.13 kernel SQL causing error : select
com.att.gateway.'database'.StatusMessageProcedures.'add'(@p0)ě
00:00000:00009:2000/06/12 13:00:25.13 kernel
************************************
00:00000:00009:2000/06/12 13:00:25.13 server SQL Text: select
com.att.gateway.'database'.StatusMessageProcedures.'add'(@p0)ě
00:00000:00009:2000/06/12 13:00:25.13 kernel curdb = 7 pstat = 0x10000
lasterror = 0
00:00000:00009:2000/06/12 13:00:25.13 kernel preverror = 0 transtate = 1
00:00000:00009:2000/06/12 13:00:25.13 kernel curcmd = 0 program =
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x00633430
pcstkwalk+0x24(0xeae77110, 0x00000000, 0x0000270f, 0x00000002, 0xfffffff8)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x0063333c
ucstkgentrace+0x194(0x00d60031, 0xeb1d2380, 0xeb1d2380, 0xeaea5120, 0x00000000)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x00603138
ucbacktrace+0xa8(0xeaea5120, 0x00000001, 0x00d60031, 0xeb18c7a0, 0x00000000)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x000f43f0
terminate_process+0xcf8(0x00bc1494, 0x000054e8, 0x000054e4, 0xffffffff,
0x00005000)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x0013a9a4
hdl_default+0x48(0x0000006b, 0x00000008, 0x00000019, 0x00000001, 0xeae773d0)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x0013a5b0
ex_raise+0x20c(0xeb1d78c0, 0x00000000, 0x00000019, 0x00000001, 0x00007361)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x0011ccd4
tdsrecv__onepfmt+0x354(0x00000000, 0x00006400, 0x00005000, 0xeb1d2380,
0xeb97465d)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x0011d0bc
tdsrecv_paramfmt+0x344(0xeb974650, 0x00000000, 0xeb1d8b04, 0xeb1d2380,
0x00000000)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x0011a5a0
tdsrecv_language+0x344(0x00bb2c00, 0x00bc2000, 0x00000001, 0x00005000,
0x00005400)
00:00000:00009:2000/06/12 13:00:25.13 kernel [Handler pc: 0x0013a7a0
hdl_backout installed by the following function:-]
00:00000:00009:2000/06/12 13:00:25.13 kernel [Handler pc: 0x0033540c ut_handle
installed by the following function:-]
00:00000:00009:2000/06/12 13:00:25.13 kernel [Handler pc: 0x0033540c ut_handle
installed by the following function:-]
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x001296c0
conn_hdlr+0x2044(0x00bc2000, 0x00bb2c00, 0x00000000, 0x000054e4, 0x00005400)
00:00000:00009:2000/06/12 13:00:25.13 kernel pc: 0x00645c98
_coldstart(0x00000003, 0x0012767c, 0x00000000, 0x00000000, 0x00000000)
00:00000:00009:2000/06/12 13:00:25.13 kernel end of stack trace, spid 9, kpid
14024753, suid 5

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

Lance Andersen

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
There is no jConnect issue here but instead an ASE issue.

What happens if you do the same query from isql?

Try using a Statement vs. PreparedStatement as it could be possible the
problem has to do with the TDS params that are sent for the
PreparedStatement (setting LITERAL_PARAMS=true should also address this
issue).

We need to narrow down where/why ASE is barfing.

Lance

--
===============================================================================
Lance J. Andersen Email: lan...@sybase.com
Sybase Product Support Engineering Phone:(781) 564-6336
77 South Bedford Street Fax: (781) 564-7001
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================

Kenneth Rabe

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
I've done the same statement using both a stored procedure and through isql and
have had no problems with either one of them. I don't believe that using a
Statement will work since I am using PreparedStatement for the setObject method.
I just tried setting LITERAL_PARAMS to true and now when the same code executes,
I get a SQL NULL exception. Sometime in the past, you mentioned:

>- LITERAL_PARAMS to true, the query will be sent as a Language command with no
>parameters (that is the complete string is sent to the backend).

This leads me to believe that if I want to send a java object as a parameter,
setting LITERAL_PARAMS to true causes a SQL NULL exception to be raised because
that is the default value being passed.

Thank you for any help you can provide.
Kenneth Rabe


The exception being raised:
com.sybase.jdbc2.jdbc.SybSQLException: You cannot pass a SQL NULL value as an
argument to a Java method.

at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)

at java.lang.Exception.<init>(Exception.java:42)
at java.sql.SQLException.<init>(SQLException.java:43)
at com.sybase.jdbc2.jdbc.SybSQLException.<init>(SybSQLException.java:73)
at com.sybase.jdbc2.tds.Tds.processEed(Compiled Code)
at com.sybase.jdbc2.tds.Tds.nextResult(Compiled Code)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(Compiled Code)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(Compiled Code)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:182)
at
com.sybase.jdbc2.jdbc.SybStatement.executeLoop(SybStatement.java:1535)
at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:1527)


at
com.sybase.jdbc2.jdbc.SybPreparedStatement.execute(SybPreparedStatement.java:511
)
at

com.att.gateway.server.connectionInstance.StatusMessageConnectionInstance.add(St
atusMessageConnectionInstance.java:88)


On Tue, 13 Jun 2000 07:05:51 -0400,
in sybase.public.jconnect50

Lance Andersen

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
isql sends everything as a language command.

what LITERAL_PARAMS does is instruct the driver to simply change
the TDS. What it will do is to a Language command.

If you used isql, than the object is in the db already.

if you can put together a simple repro with everything needed, we
can take a peek.

0 new messages