X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D8F519FB37F for ; Wed, 30 Aug 2006 22:00:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 94524-03 for ; Wed, 30 Aug 2006 22:00:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 0ADEB9FB37A for ; Wed, 30 Aug 2006 22:00:05 -0300 (ADT) Received: (qmail 26763 invoked from network); 31 Aug 2006 01:00:04 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 31 Aug 2006 01:00:04 -0000 In-Reply-To: <44F6309D.7010607@imageworks.com> References: <44F61B1B.4030009@imageworks.com> <4FBCA43B-C86C-4FEC-ADE1-DBA8986E1760@fastcrypt.com> <44F6309D.7010607@imageworks.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2F2DFD51-CFE5-490E-BFA3-A5ACC3448449@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: jdbc3, pg 8.1.4 , and stored procedures Date: Wed, 30 Aug 2006 21:00:02 -0400 To: chambers@imageworks.com X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.048 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/183 X-Sequence-Number: 15710 On 30-Aug-06, at 8:43 PM, Matt Chambers wrote: > Thanks for response. > > Do you happen to know what 'Malformed function or procedure escape > syntax at offset 4' means? That might get me going in the right > direction. > I will see what I can do about a code example.. There are a couple > layers of abstraction and some casting I would want to put into the > example. One thing I noticed was that when using the 7.4 driver, > while it did work, would say "idle in transaction" next to the > process. Yeah, that was a bug in the 7.4 driver. As far as the Malformed function goes. It's a syntax error in the call, but it looks pretty normal which is why I wanted a self contained test that failed. > > Also, what I said about every stored procedure, turns out that is > false. It seems the ones that don't work are the ones that return > cursors. That code looks something like this. Looks like its > abstracted to handle normal queries and stored procedure calls. > ob_is_call is set to true if they are calling a stored procedure, > false if its a normal query. The SQLCleaner handles close() stuff. > > public Tresult query ( PreparedStatement x_stmt, Tparam > x_param ) throws SQLException { > ResultSet x_rset = null; > if ( ob_is_call ) { > ((CallableStatement) x_stmt).registerOutParameter( 1, > Types.OTHER ); > x_stmt.setObject ( 2, x_param ); > x_stmt.execute (); > x_rset = (ResultSet) ((CallableStatement) > x_stmt).getObject(1); > } else { > x_stmt.setObject ( 1, x_param ); > x_rset = x_stmt.executeQuery (); > } > try { > return handle ( x_rset ); > } finally { > SqlCleaner.cleanUpSqlSession ( x_rset ); > } > } > > -Matt > > Dave Cramer wrote: > >> Matt, >> >> That's pretty strange, the test suite in the driver uses exactly >> the same syntax. >> Can you send a self contained test that fails ? >> >> Dave >> On 30-Aug-06, at 7:11 PM, Matt Chambers wrote: >> >>> Greetings. I've inherited this Tomcat / Postgres application and >>> I'm having a problem, not sure what is. Basically, its a >>> postgres 8.1.4 server and a tomcat application. All of the SQL >>> is done in plpgsql, which is called with prepareCall statements, >>> example: >>> >>> "{ ? = call getDispatchList ( ? ) }" >>> >>> With the 7.4 driver it works, with the 8.1 driver every query >>> fails with: >>> >>> WARNING: Caught unexpected: org.postgresql.util.PSQLException: >>> Malformed function or procedure escape syntax at offset 4., >>> org.postgresql.util.PSQLException: Malformed function or >>> procedure escape syntax at offset 4. >>> >>> I've been able to move the other applications over to the 8.1 >>> driver (none use stored procedures) no problem. What is the secret? >> > > >