<!-- 
RSS generated by JIRA (4.4#649-r158309) at Tue May 21 03:58:58 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/si/jira.issueviews:issue-xml/CLJ-676/CLJ-676.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-676] Calling seq on the resultset-seq of an empty ResultSet throws an exception</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-676</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;The clojure.sql/resultset-seq function returns a seq over the JDBC ResultSet.  &lt;/p&gt;

&lt;p&gt;&lt;b&gt;Expected:&lt;/b&gt; calling seq on an empty ResultSet should return nil&lt;br/&gt;
&lt;b&gt;Actual:&lt;/b&gt; throws an error due to a closed ResultSet&lt;/p&gt;

&lt;p&gt;Example:&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;(def db {:classname &lt;span class=&quot;code-quote&quot;&gt;&quot;oracle.jdbc.driver.OracleDriver&quot;&lt;/span&gt;
         :subprotocol &lt;span class=&quot;code-quote&quot;&gt;&quot;oracle:thin&quot;&lt;/span&gt;
         :subname &lt;span class=&quot;code-quote&quot;&gt;&quot;@detroit:1521:XE&quot;&lt;/span&gt;
         :user &lt;span class=&quot;code-quote&quot;&gt;&quot;ted&quot;&lt;/span&gt;
         :password &lt;span class=&quot;code-quote&quot;&gt;&quot;nugent&quot;&lt;/span&gt;
         :schema &lt;span class=&quot;code-quote&quot;&gt;&quot;sweaty&quot;&lt;/span&gt;})

(with-connection db
  (with-query-results res [&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT 1 FROM dual WHERE 0=1&quot;&lt;/span&gt;]
    (seq res)))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;returns:&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;java.sql.SQLRecoverableException: Closed Resultset: next
  [Thrown class java.lang.RuntimeException]

Backtrace:
  0: clojure.lang.LazySeq.sval(LazySeq.java:47)
  1: clojure.lang.LazySeq.seq(LazySeq.java:56)
  2: clojure.lang.Cons.next(Cons.java:39)
  3: clojure.lang.RT.next(RT.java:560)
  4: clojure.core$next.invoke(core.clj:61)
  5: clojure.core$nthnext.invoke(core.clj:3399)
  6: clojure.core$print_sequential.invoke(core_print.clj:55)
  7: clojure.core$fn__4845.invoke(core_print.clj:138)
  8: clojure.lang.MultiFn.invoke(MultiFn.java:167)
  9: clojure.core$pr_on.invoke(core.clj:2812)
 10: clojure.core$pr.invoke(core.clj:2824)
 11: clojure.lang.AFn.applyToHelper(AFn.java:163)
 12: clojure.lang.RestFn.applyTo(RestFn.java:133)
 13: clojure.core$apply.invoke(core.clj:540)
 14: clojure.core$pr_str.doInvoke(core.clj:3700)
 15: clojure.lang.RestFn.invoke(RestFn.java:409)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Suggested workaround: &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;(with-connection db
  (with-query-results res [&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT 1 FROM dual WHERE 0=0&quot;&lt;/span&gt;]
    (not (empty? res))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14284">CLJ-676</key>
            <summary>Calling seq on the resultset-seq of an empty ResultSet throws an exception</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="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="2">Declined</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="alexmiller">Alex Miller</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 16:13:56 -0600</created>
                <updated>Fri, 17 Dec 2010 19:56:22 -0600</updated>
                    <resolved>Fri, 17 Dec 2010 19:56:22 -0600</resolved>
                            <version>Release 1.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="26055" author="stuart.sierra" created="Fri, 17 Dec 2010 19:56:22 -0600"  >&lt;p&gt;This is not a Clojure issue.  clojure.contrib.sql is part of the old clojure-contrib project, soon to be replaced.&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>