spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynold Xin <r...@databricks.com>
Subject Re: Tiny curiosity question on closing the jdbc connection
Date Tue, 05 Aug 2014 20:03:42 GMT
I'm pretty sure it is an oversight. Would you like to submit a pull request
to fix that?



On Tue, Aug 5, 2014 at 12:14 PM, Stephen Boesch <javadba@gmail.com> wrote:

> Within its compute.close method, the JdbcRDD class has this interesting
> logic for closing jdbc connection:
>
>
>       try {
>         if (null != conn && ! stmt.isClosed()) conn.close()
>         logInfo("closed connection")
>       } catch {
>         case e: Exception => logWarning("Exception closing connection", e)
>       }
>
> Notice that the second check is on stmt  having been closed - not on the
> connection.
>
> I would wager this were not a simple oversight and there were some
> motivation for this logic- curious if anyone would be able to shed some
> light?   My particular interest is that I have written custom ORM's in jdbc
> since late 90's  and never did it this way.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message