ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Andrews <peter.andr...@Dartmouth.EDU>
Subject Re: 2 bugs calling stored procs -- no commit and nullPointerException
Date Wed, 22 Nov 2006 18:22:30 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Thanks again Jeff for responding.<br>
Since I have a workaround and it appears the bug is not in iBATIS we
can forget about it as far as I am concerned.<br>
The second issue, where no commit is being sent despite
commitRequired=true is more problematic.<br>
Jeff Butler wrote:
  <div>iBATIS is calling different JDBC APIs for the different
statements.&nbsp; When you have it configured as a procedure, iBATIS is
calling JDBC's prepareCall API.&nbsp; Otherwise, iBATIS is calling JDBC's
prepareStatement API.&nbsp; This is why you're seeing different results from
the different configurations.
  <div>I still believe that the &lt;procedure&gt; problem lies in the
MySQL driver.&nbsp; If you're adventurous, try this raw JDBC code to see if
you still get the error (this is essentially what iBATIS is doing with
the &lt;statement&gt; configuration):
  <div>Connection connection = ... (get the connection from Driver
  <div>CallableStatement cs = connection.prepareCall ("<font
 color="#550055">{CALL deleteDatasetByResearcherIdAndId(?,?)}"</font>);</div>
  <div>cs.setBigDecimal(1, new BigDecimal("1"));</div>
  <div>cs.setBigDecimal(2, new BigDecimal("1"));</div>
  <div>Also look at these very recent MySQL bugs for similar issues
(not related to iBATIS):</div>
  <div><a href="http://bugs.mysql.com/bug.php?id=24065">http://bugs.mysql.com/bug.php?id=24065</a></div>
  <div><a href="http://bugs.mysql.com/bug.php?id=22297">http://bugs.mysql.com/bug.php?id=22297</a></div>
  <div>Jeff Butler</div>
  <div><span class="gmail_quote">On 11/22/06, <b
 class="gmail_sendername">Peter Andrews</b> &lt;<a
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left:
    <div bgcolor="#ffffff" text="#000000">I think the null pointer
exception is related to iBATIS because if I wrap the identical call in
a delete element rather than a procedure element, the procedure is
called and works just fine.
This works:<span class="q"><br>
&nbsp;&lt;delete id="deleteDatasetByResearcherIdAndId"&nbsp;
&nbsp;&nbsp;&nbsp; {CALL deleteDatasetByResearcherIdAndId(#pResearcherId:NUMERIC#,
&nbsp; &lt;/delete&gt;<br>
    </span>This throws null pointer exception:<span class="q"><br>
&nbsp; &lt;procedure id="deleteDatasetByResearcherIdAndIdProcedure"&nbsp;
resultClass="Integer" parameterClass="Map"&gt;
&nbsp;&nbsp;&nbsp; {CALL deleteDatasetByResearcherIdAndId(#pResearcherId:NUMERIC#,
#pDatasetId:NUMERIC# )}<br>
&nbsp; &lt;/procedure&gt;<br>
    </span>This hangs:<span class="q"><br>
&nbsp; &lt;statement id="deleteDatasetByResearcherIdAndIdStatement"&nbsp;
resultClass="Integer" parameterClass="Map"&gt;
&nbsp;&nbsp;&nbsp; {CALL deleteDatasetByResearcherIdAndId(#pResearcherId:NUMERIC#,
&nbsp; &lt;/statement&gt;<br>
&nbsp; <br>
<pre class="moz-signature" cols="72">-- 
Peter Andrews
Software Engineer
Dartmouth Medical School
Computational Genetics
Rubin 707
(603) 653-3598
<a class="moz-txt-link-abbreviated" href="mailto:Peter.Andrews@dartmouth.edu">Peter.Andrews@dartmouth.edu</a>

View raw message