<!--
RSS generated by JIRA (4.4#649-r158309) at Fri May 24 08:22:46 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+JDBC+AND+resolution+%3D+Unresolved+AND+fixVersion+is+EMPTY+ORDER+BY+priority+DESC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://dev.clojure.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Clojure JIRA</title>
        <link>http://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+JDBC+AND+resolution+%3D+Unresolved+AND+fixVersion+is+EMPTY+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="6" total="6"/>
                <build-info>
            <version>4.4</version>
            <build-number>649</build-number>
            <build-date>25-07-2011</build-date>
        </build-info>
<item>
            <title>[JDBC-48] Support stored procedures with CallableStatement</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-48</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;JDBC&apos;s &lt;tt&gt;CallableStatement&lt;/tt&gt; provides support for calling stored procedures. More specifically, it allows you to register OUT parameters which will become the statements (possibly many) &lt;tt&gt;ResultSet&lt;/tt&gt; objects. A &lt;tt&gt;CallableStatement&lt;/tt&gt; &lt;em&gt;is a&lt;/em&gt; &lt;tt&gt;PreparedStatement&lt;/tt&gt;, so I am hoping there wont be too much involved with regard to executing them. The main difference is being able to register and consume OUT parameters.&lt;/p&gt;

&lt;p&gt;I&apos;ll be hacking on this, so patches are forthcoming. Any input is appreciated.&lt;/p&gt;</description>
                <environment></environment>
            <key id="16090">JDBC-48</key>
            <summary>Support stored procedures with CallableStatement</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="jeremyheiler">Jeremy Heiler</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Mar 2013 13:50:23 -0500</created>
                <updated>Fri, 15 Mar 2013 22:51:30 -0500</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="30767" author="seancorfield" created="Fri, 15 Mar 2013 22:51:30 -0500"  >&lt;p&gt;I&apos;ve never used stored procs (I don&apos;t like the complexity that I&apos;ve seen them add to version control, change management and deployment) so I&apos;m afraid I can&apos;t offer any input - but I really appreciate you taking this on! Thank you!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[JDBC-37] Provide support for alternate transaction strategies</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-37</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;The current design of java.jdbc prevents its use as a participant in a distributed XA transaction, where transactional control is delegated to a TransactionManager. It only works with local transactions and absorbs all nested transactions into the outermost one. It&apos;d be nice to have a clean way to override this default behavior.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15608">JDBC-37</key>
            <summary>Provide support for alternate transaction strategies</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="jcrossley3">Jim Crossley</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Jul 2012 17:48:54 -0500</created>
                <updated>Fri, 3 May 2013 12:50:19 -0500</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29062" author="jcrossley3" created="Tue, 31 Jul 2012 17:49:18 -0500"  >&lt;p&gt;I&apos;ll try to work up a straw-man solution and submit a pull-request.&lt;/p&gt;</comment>
                    <comment id="29063" author="seancorfield" created="Tue, 31 Jul 2012 17:59:35 -0500"  >&lt;p&gt;Thanx Jim. I agree the current setup isn&apos;t ideal in that area. As for &quot;pull-request&quot;, I assume you mean a patch attached to this JIRA ticket (since Clojure and contrib projects cannot accept pull requests). Please also make sure you get a Contributor&apos;s Agreement on file per &lt;a href=&quot;http://clojure.org/contributing&quot;&gt;http://clojure.org/contributing&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="29064" author="jcrossley3" created="Tue, 31 Jul 2012 18:25:47 -0500"  >&lt;p&gt;Sure thing, Sean&lt;/p&gt;</comment>
                    <comment id="29078" author="jcrossley3" created="Thu, 2 Aug 2012 18:31:48 -0500"  >&lt;p&gt;Sean, here&apos;s a first whack introducing a new dynamic var for transaction strategy. &lt;/p&gt;

&lt;p&gt;I know the desire is for a new API with explicit parameter passing, and when that vision congeals, I&apos;m happy to help migrate, but I&apos;d like to always have the option of the dynamic binding as well.&lt;/p&gt;

&lt;p&gt;My thinking is that if a tx strategy function is passed as a parameter, it&apos;ll override whatever may be set in the dynamic var, but how it gets passed is still unclear to me. I considered adding an optional key to the db-spec, but wanted to run that by you first.&lt;/p&gt;

&lt;p&gt;The Agreement is in the mail. I appreciate your feedback.&lt;/p&gt;</comment>
                    <comment id="30900" author="seancorfield" created="Sun, 7 Apr 2013 03:46:49 -0500"  >&lt;p&gt;There have been a lot of code changes lately and this patch no longer applies cleanly. Can you submit a new patch against the latest master? Thanx!&lt;/p&gt;</comment>
                    <comment id="31025" author="jcrossley3" created="Tue, 30 Apr 2013 17:43:42 -0500"  >&lt;p&gt;Sean, I&apos;m not sure I&apos;m totally smitten with the new &quot;transaction?&quot; boolean parameter. At first glance, this seems an awkward way to define a transaction consisting of multiple statements. Can you provide an example usage with the new API of say, inserting, updating and deleting data within a single transaction? I&apos;m hoping an example will clear up my confusion and I can propose a way of parameterizing a particular strategy for executing any transaction.&lt;/p&gt;</comment>
                    <comment id="31027" author="seancorfield" created="Tue, 30 Apr 2013 17:47:22 -0500"  >&lt;p&gt;See &quot;Using Transactions&quot; here &lt;a href=&quot;https://github.com/clojure/java.jdbc/blob/master/doc/clojure/java/jdbc/UsingSQL.md&quot;&gt;https://github.com/clojure/java.jdbc/blob/master/doc/clojure/java/jdbc/UsingSQL.md&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="31028" author="jcrossley3" created="Tue, 30 Apr 2013 18:30:25 -0500"  >&lt;p&gt;Yes, I saw that, and it seemed to confirm that my original patch should work with minor tweaking. And then I was surprised to see the &quot;transactional?&quot; option in the source. I was curious how you expect it to be used.&lt;/p&gt;</comment>
                    <comment id="31030" author="seancorfield" created="Tue, 30 Apr 2013 18:58:52 -0500"  >&lt;p&gt;Folks have asked for the ability to run various functions without an implicit transaction inside them - in fact for some DBs, certain commands cannot be run inside a transaction which was a problem with the old API where you couldn&apos;t turn that off. It allows users to have more explicit control over transactions and it&apos;s also a convenient &quot;implementation artifact&quot; for nesting calls.&lt;/p&gt;

&lt;p&gt;So, bottom line: I expect very few users to actually use it explicitly, unless they specifically need to turn off the implicit transaction wrapping.&lt;/p&gt;

&lt;p&gt;And for most of the API that users will interact with, they don&apos;t even need to worry about it.&lt;/p&gt;

&lt;p&gt;Does that help?&lt;/p&gt;</comment>
                    <comment id="31031" author="seancorfield" created="Tue, 30 Apr 2013 19:04:17 -0500"  >&lt;p&gt;Addressing your question about your patch: Clojure/core specifically wanted java.jdbc to move away from dynamically bound variables, which the new API / implementation achieves (given that all the old API that depends on &lt;b&gt;dynamic-vars&lt;/b&gt; is deprecated now and will be completely removed before 1.0.0).&lt;/p&gt;

&lt;p&gt;If all you need is the ability to specify how the transaction function does its job, via a HOF, then I&apos;ll have a look at what that would take in the context of the new &apos;world&apos;...&lt;/p&gt;</comment>
                    <comment id="31034" author="jcrossley3" created="Tue, 30 Apr 2013 19:33:35 -0500"  >&lt;p&gt;Regarding dynamically bound variables, I think it&apos;s very common and accepted &amp;#8211; even canonical? &amp;#8211; to use them (or some ThreadLocal-like variant) to implement transactions. I would hate to make the api awkward just to avoid them.&lt;/p&gt;

&lt;p&gt;But to answer the core question, yes, I think it&apos;s important to provide an alternative to the assumptions encoded into db-transaction*, e.g. &quot;Any nested transactions are absorbed into the outermost transaction.&quot; I might prefer a strategy in which a nested transaction suspends the current one and creates another, assuming the driver supports it.&lt;/p&gt;

&lt;p&gt;But my primary reason for this, as you know, is to somehow inject a &quot;null strategy&quot; to support distributed transactions, delegating the commit/rollback choice to an external &quot;transaction manager&quot;.&lt;/p&gt;

&lt;p&gt;One question: what do you mean by &quot;implementation artifact&quot; for nesting calls?&lt;/p&gt;</comment>
                    <comment id="31037" author="jcrossley3" created="Wed, 1 May 2013 09:46:22 -0500"  >&lt;p&gt;Sean, how do you feel about turning the &lt;tt&gt;:transactional?&lt;/tt&gt; option to a function instead of a boolean? And that function represents the &lt;tt&gt;:tx-strategy&lt;/tt&gt; used, which could assume the value of a dynamically bound value &lt;tt&gt;&amp;#42;tx-strategy&amp;#42;&lt;/tt&gt; by default, and its value would be &lt;tt&gt;db-transaction*&lt;/tt&gt; by default. And folks could set it to nil to turn off transactions, i.e. &lt;tt&gt;:tx-strategy nil&lt;/tt&gt; or perhaps &lt;tt&gt;:tx-strategy :none&lt;/tt&gt; would equate to &lt;tt&gt;:transactional? false&lt;/tt&gt;. I think that may satisfy core&apos;s recommendation for dynamic variables not being the &lt;b&gt;only&lt;/b&gt; way to alter behavior. Make sense at all? &lt;/p&gt;</comment>
                    <comment id="31039" author="seancorfield" created="Wed, 1 May 2013 10:57:47 -0500"  >&lt;p&gt;I was looking at the code again last night and came to much the same conclusion! I&apos;ll take a run at that this weekend (but I&apos;m not adding a &lt;b&gt;dynamic&lt;/b&gt; variable - Clojure/core were very clear about their reasons for not wanting those in code except in extremely rare situations in code that is guaranteed to be single-threaded).&lt;/p&gt;</comment>
                    <comment id="31040" author="jcrossley3" created="Wed, 1 May 2013 11:22:36 -0500"  >&lt;p&gt;You&apos;re killing me! &lt;img class=&quot;emoticon&quot; src=&quot;http://dev.clojure.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Without the dynamic var, I can&apos;t see any way to transparently allow the db code to participate in a distributed transaction. Can we at least agree that transactional code is guaranteed to be &lt;b&gt;effectively&lt;/b&gt; single-threaded? And by this I mean that a transaction must be associated with a single connection, so any thread using that connection must have exclusive access. Do you really want to force folks using distributed transactions to pass the tx strategy in with every call? I don&apos;t think adding the dynamic var and the option to override it violates the spirit of this guideline: &quot;If you present an interface that implicitly passes a parameter via dynamic binding (e.g. db in sql), also provide an identical interface but with the parameter passed explicitly.&quot;&lt;/p&gt;

&lt;p&gt;What was the specific feedback you received that contradicts that?&lt;/p&gt;</comment>
                    <comment id="31042" author="jcrossley3" created="Fri, 3 May 2013 06:44:33 -0500"  >&lt;p&gt;Sean, I came up with a different solution for using java.jdbc with an XA connection that obviates this issue. So even though I think it&apos;s useful to provide both a dynamic var and a function option as a means to override the logic of &lt;tt&gt;db-transaction*&lt;/tt&gt;, I no longer have a need for it.&lt;/p&gt;

&lt;p&gt;Keep up the good work on java.jdbc!&lt;/p&gt;</comment>
                    <comment id="31044" author="seancorfield" created="Fri, 3 May 2013 12:40:25 -0500"  >&lt;p&gt;I like problems that go away of their own accord but I still like the idea of making the transaction strategy a function so I&apos;ll look at that anyway as a possible (breaking) change for alpha2.&lt;/p&gt;</comment>
                    <comment id="31045" author="jcrossley3" created="Fri, 3 May 2013 12:50:19 -0500"  >&lt;p&gt;Something else you might consider: define a protocol function that encapsulates your &lt;tt&gt;commit/rollback/setAutoCommit&lt;/tt&gt; logic inside &lt;tt&gt;db-transaction*&lt;/tt&gt; and extend it to &lt;tt&gt;java.sql.Connection&lt;/tt&gt;. That way, folks could extend their more specific types, e.g. &lt;tt&gt;XAConnection&lt;/tt&gt;, to your protocol (and avoid making those calls that aren&apos;t allowed by XA). &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11408" name="jdbc-37.diff" size="2579" author="jcrossley3" created="Thu, 2 Aug 2012 18:31:48 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[JDBC-53] create-table &amp; drop-table doesn&apos;t honor naming strategy</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-53</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;create-table &amp;amp; drop-table doesn&apos;t take the current naming strategy into account.&lt;/p&gt;</description>
                <environment></environment>
            <key id="16156">JDBC-53</key>
            <summary>create-table &amp; drop-table doesn&apos;t honor naming strategy</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="r0man">Roman Scherer</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Apr 2013 08:47:12 -0500</created>
                <updated>Sun, 12 May 2013 20:56:38 -0500</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="30987" author="seancorfield" created="Wed, 24 Apr 2013 11:08:25 -0500"  >&lt;p&gt;Just to note: the naming strategy stuff, based on dynamically bound globals, is all deprecated in 0.3.0. Alternatives to create-table and drop-table, which respect the new entities function approach, will be provided in an upcoming alpha build of 0.3.0.&lt;/p&gt;</comment>
                    <comment id="31084" author="davidj" created="Sat, 11 May 2013 20:51:07 -0500"  >&lt;p&gt;Any update on this? I noticed the deprecations while reading the code. Could you say a few words or add a few docs on the 0.3 way of doing naming strategies?&lt;/p&gt;</comment>
                    <comment id="31085" author="seancorfield" created="Sat, 11 May 2013 23:20:08 -0500"  >&lt;p&gt;The replacement is entities and identifiers (as keyword arguments in java.jdbc functions and as macros in java.jdbc.sql). You can see some examples here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://clojure.github.io/java.jdbc/doc/clojure/java/jdbc/NameMapping.html&quot;&gt;http://clojure.github.io/java.jdbc/doc/clojure/java/jdbc/NameMapping.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Replacements for create-table / drop-table will be added before beta1. I&apos;m not sure right now how many more alphas we&apos;ll have. There&apos;s a lot of churn in the code right now and I want it to be feature complete and fairly settled before the first beta.&lt;/p&gt;</comment>
                    <comment id="31086" author="moquist" created="Sun, 12 May 2013 20:56:38 -0500"  >&lt;p&gt;Thanks for the update; looking forward to it!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[JDBC-40] insert nulls using .setNull (e.g. for Teradata)</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-40</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;Hi, I am using this nice package with a large (government) Teradata machine. I found that I can not insert nil values using &lt;tt&gt;insert-rows&lt;/tt&gt;: the Teradata JDBC driver tells me to use &lt;tt&gt;.setNull&lt;/tt&gt; or the form of &lt;tt&gt;.setObject&lt;/tt&gt; including an SQL type code.&lt;/p&gt;

&lt;p&gt;The following replacement definition of &lt;tt&gt;set-parameters&lt;/tt&gt; was the only change needed to get this to work.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(defn- set-parameters
  &lt;span class=&quot;code-quote&quot;&gt;&quot;Add the parameters to the given statement.&quot;&lt;/span&gt;
  [^PreparedStatement stmt params]
  (let [pmd (.getParameterMetaData stmt)]
    (dorun
     (map-indexed
      (fn [ix value]
        (let [typ (.getParameterType pmd (inc ix))]
          (&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (nil? value)
            (.setNull stmt (inc ix) typ)
            (.setObject stmt (inc ix) value typ))))
      params))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I am not sure whether the use of &lt;tt&gt;.getParameterMetaData&lt;/tt&gt; is a generally appropriate because the docs &lt;a href=&quot;http://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html&quot;&gt;http://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html&lt;/a&gt; say:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For some queries and driver implementations, the data that would be returned by a ParameterMetaData object may not be available until the PreparedStatement has been executed.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Anyway it does work for Teradata. Maybe it could be an option?&lt;/p&gt;


&lt;p&gt;It just occurred to me that it is probably inefficient to retrieve the parameter metadata on every call to &lt;tt&gt;set-parameters&lt;/tt&gt;. It could be done in &lt;tt&gt;insert-rows&lt;/tt&gt; instead. On the other hand, I didn&apos;t actually notice any performance hit when inserting 40,000 rows.&lt;/p&gt;</description>
                <environment>Teradata 14</environment>
            <key id="15746">JDBC-40</key>
            <summary>insert nulls using .setNull (e.g. for Teradata)</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="4" iconUrl="http://dev.clojure.org/jira/images/icons/status_reopened.gif">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="floybix">Felix Andrews</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Oct 2012 06:07:37 -0500</created>
                <updated>Mon, 22 Apr 2013 04:26:18 -0500</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="30893" author="seancorfield" created="Sun, 7 Apr 2013 01:07:33 -0500"  >&lt;p&gt;This was a tricky one. Both .getParameterMetadataData and .getParameterType can throw exceptions. On MS SQL Server, if there is a syntax error in the SQL, the former throws an Exception. On MySQL, the latter throws an exception (every time as far as I can tell, even tho&apos; .getParameterMetaData succeeds). That introduces quite a performance penalty for MySQL (about 10% in my tests).&lt;/p&gt;

&lt;p&gt;However, if I treated MySQL as a special case and swallowed all exceptions and had a fallback to the original .setObject call, I could get everything to pass the test suite without a noticeable performance overhead (still measuring the latest MySQL performance as I write this).&lt;/p&gt;

&lt;p&gt;Although it will probably slow everyone down a little, having to make these calls, it should be more robust and may make the .setObject calls faster in some situations?&lt;/p&gt;</comment>
                    <comment id="30894" author="seancorfield" created="Sun, 7 Apr 2013 01:24:32 -0500"  >&lt;p&gt;Fixed in 0.3.0-SNAPSHOT. May need to be revisited for performance tweaks later. Uncomfortable with MySQL being a special case here... &lt;img class=&quot;emoticon&quot; src=&quot;http://dev.clojure.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="30965" author="seancorfield" created="Wed, 17 Apr 2013 18:48:14 -0500"  >&lt;p&gt;This fix breaks PostgreSQL and already has MySQL as an exception so I&apos;m going to roll it back and we&apos;ll have to find another way to support Teradata I&apos;m afraid!).&lt;/p&gt;</comment>
                    <comment id="30981" author="pmoriarty" created="Mon, 22 Apr 2013 04:26:18 -0500"  >&lt;p&gt;PostgreSQL also complains about use of setObject with a null object and no parameter type when using protocolVersion 3. &lt;/p&gt;

&lt;p&gt;Seems to work ok with protocolVersion 2 though.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[JDBC-1] Provide option to return SQL generated / execution stats</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-1</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;Shantanu: Provide a mechanism to show the SQL being executed (configurable, so that it can be turned off)&lt;/p&gt;

&lt;p&gt;Sean: Good idea. Even better, a way to access statistics about the prepared statement after execution - timing etc?&lt;/p&gt;

&lt;p&gt;Shantanu: Yes, that would be an add-on value to show how are the queries performing.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14416">JDBC-1</key>
            <summary>Provide option to return SQL generated / execution stats</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="seancorfield">Sean Corfield</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 May 2011 21:12:52 -0500</created>
                <updated>Sun, 8 May 2011 21:12:52 -0500</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[JDBC-56] Problem with find-connection when using agents with c3p0 connection pool</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-56</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;I use an agent to offload email processing and update a db on completion. If I use a c3p0 connection pool, I get an exception and a complaint that the connection isn&apos;t open (see stacktrace). The code works if I wrap the agent fn in a clojure.java.jdbc/with-connection and get a connection from the pool in the agent thread.&lt;/p&gt;

&lt;p&gt;The in jdbc.clj, the find-connection (db-find-connection in HEAD) checks for an existing connection and tries to use it without checking if it&apos;s open. This causes an exception with a c3p0 connection that was acquired in another thread.&lt;/p&gt;

&lt;p&gt;Here&apos;s the stacktrace I&apos;m seeing (note the &quot;You can&apos;t operate on a closed Connection!!!&quot;):&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;2013-05-16 10:32:22,208 [clojure-agent-send-off-pool-7] DEBUG com.mchange.v2.sql.SqlUtils - Converting Throwable to SQLException...
java.lang.NullPointerException
	at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:186)
	at clojure.java.jdbc$prepare_statement.doInvoke(jdbc.clj:450)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at clojure.lang.AFn.applyToHelper(AFn.java:163)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invoke(core.clj:621)
	at clojure.java.jdbc$with_query_results_STAR_.invoke(jdbc.clj:646)
	at clj_record.core$find_by_sql$func__3362__auto____3378.invoke(core.clj:72)
	at clj_record.core$find_by_sql.invoke(core.clj:71)
	at clj_record.core$find_records.invoke(core.clj:85)
	at clj_record.core$find_record.invoke(core.clj:91)
	at neataudio.domain.interview_participant_relationship$find_record.invoke(interview_participant_relationship.clj:18)
	at neataudio.domain.interview_participant_relationship$update_email_status.invoke(interview_participant_relationship.clj:37)
	at neataudio.controllers.participant_controller$notify$fn__5113$fn__5114$func__3362__auto____5115$fn__5116.invoke(participant_controller.clj:104)
	at clojure.java.jdbc$transaction_STAR_$fn__3162.invoke(jdbc.clj:372)
	at clojure.java.jdbc$transaction_STAR_.invoke(jdbc.clj:371)
	at neataudio.controllers.participant_controller$notify$fn__5113$fn__5114$func__3362__auto____5115.invoke(participant_controller.clj:101)
	at neataudio.controllers.participant_controller$notify$fn__5113$fn__5114.invoke(participant_controller.clj:101)
	at neataudio.controllers.participant_controller$notify$fn__5113.invoke(participant_controller.clj:101)
	at clojure.lang.AFn.applyToHelper(AFn.java:185)
	at clojure.lang.AFn.applyTo(AFn.java:151)
	at clojure.core$apply.invoke(core.clj:623)
	at clojure.core$binding_conveyor_fn$fn__4115.doInvoke(core.clj:1848)
	at clojure.lang.RestFn.applyTo(RestFn.java:146)
	at clojure.lang.Agent$Action.doRun(Agent.java:114)
	at clojure.lang.Agent$Action.run(Agent.java:163)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:680)
java.sql.SQLException: You can&apos;t operate on a closed Connection!!!
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
	at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:222)
	at clojure.java.jdbc$prepare_statement.doInvoke(jdbc.clj:450)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at clojure.lang.AFn.applyToHelper(AFn.java:163)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invoke(core.clj:621)
	at clojure.java.jdbc$with_query_results_STAR_.invoke(jdbc.clj:646)
	at clj_record.core$find_by_sql$func__3362__auto____3378.invoke(core.clj:72)
	at clj_record.core$find_by_sql.invoke(core.clj:71)
	at clj_record.core$find_records.invoke(core.clj:85)
	at clj_record.core$find_record.invoke(core.clj:91)
	at neataudio.domain.interview_participant_relationship$find_record.invoke(interview_participant_relationship.clj:18)
	at neataudio.domain.interview_participant_relationship$update_email_status.invoke(interview_participant_relationship.clj:37)
	at neataudio.controllers.participant_controller$notify$fn__5113$fn__5114$func__3362__auto____5115$fn__5116.invoke(participant_controller.clj:104)
	at clojure.java.jdbc$transaction_STAR_$fn__3162.invoke(jdbc.clj:372)
	at clojure.java.jdbc$transaction_STAR_.invoke(jdbc.clj:371)
	at neataudio.controllers.participant_controller$notify$fn__5113$fn__5114$func__3362__auto____5115.invoke(participant_controller.clj:101)
	at neataudio.controllers.participant_controller$notify$fn__5113$fn__5114.invoke(participant_controller.clj:101)
	at neataudio.controllers.participant_controller$notify$fn__5113.invoke(participant_controller.clj:101)
	at clojure.lang.AFn.applyToHelper(AFn.java:185)
	at clojure.lang.AFn.applyTo(AFn.java:151)
	at clojure.core$apply.invoke(core.clj:623)
	at clojure.core$binding_conveyor_fn$fn__4115.doInvoke(core.clj:1848)
	at clojure.lang.RestFn.applyTo(RestFn.java:146)
	at clojure.lang.Agent$Action.doRun(Agent.java:114)
	at clojure.lang.Agent$Action.run(Agent.java:163)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NullPointerException
	at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:186)
	... 28 more
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>OS X 10.8.3&lt;br/&gt;
Java 1.6.0_45&lt;br/&gt;
Clojure 1.5&lt;br/&gt;
c3p0 0.9.1.2&lt;br/&gt;
java.jdbc 0.2.1 (the problem also seems to be there in HEAD at the time of logging this)</environment>
            <key id="16188">JDBC-56</key>
            <summary>Problem with find-connection when using agents with c3p0 connection pool</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="edoloughlin">Ed O&apos;Loughlin</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 May 2013 04:43:42 -0500</created>
                <updated>Tue, 21 May 2013 12:36:16 -0500</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="31093" author="edoloughlin" created="Thu, 16 May 2013 04:50:41 -0500"  >&lt;p&gt;Apologies: this is a crappy bug report. I&apos;m under a bit of pressure at the moment so I can&apos;t make a test case.&lt;/p&gt;</comment>
                    <comment id="31128" author="seancorfield" created="Tue, 21 May 2013 12:36:16 -0500"  >&lt;p&gt;If you use the new API, you pass the db-spec into the functions and it will take care of getting the connection, using it, and closing it - and that will all happen on the same (agent) thread. I would not expect you to be able to get a connection in one thread and use it from another thread.&lt;/p&gt;

&lt;p&gt;When you get a chance, please post an example of both the working and non-working code, but my initial thinking is this isn&apos;t a bug, just an inherent limitation of working with connections across threads....?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>