Re: Is perl better? :(((
From: Lee Fesperman (firstsql_at_ix.netcom.com)
Date: 02/05/05
- Next message: Chris Smith: "Re: how to emulate goto."
- Previous message: Chris Smith: "Re: http parameter casting"
- In reply to: Chris Smith: "Re: Is perl better? :((("
- Next in thread: Chris Smith: "Re: Is perl better? :((("
- Reply: Chris Smith: "Re: Is perl better? :((("
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 05 Feb 2005 03:27:53 GMT
Chris Smith wrote:
>
> steve <me@me.com> wrote:
> > it will stop ( well actually sql crash , and it would kill any other program
> > on the server that tries to open a cursor ) after 300 cursors are left open.
> > not the way to run on a production system.
>
> Steve, you're a little late here, but just to clarify: that's not true.
> Omitting rs.close() in the code mentioned here will not leave open
> cursors anywhere, because the cursor will be closed when the next loop
> iteration calls PreparedStatement.execute(). The last cursor is closed
> when the connection is closed.
That's what the spec says, but I think that closing resultsets is needed for some
backends (Oracle). Also, you should close the prepared statement instead of waiting for
the connection to do the job. IOW, the best practice is always close resultsets,
statements and connections and do it as soon as you don't need them anymore. For a
decent backend, this should not be more costly and will free up resources on the server
... to everyone's benefit.
-- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
- Next message: Chris Smith: "Re: how to emulate goto."
- Previous message: Chris Smith: "Re: http parameter casting"
- In reply to: Chris Smith: "Re: Is perl better? :((("
- Next in thread: Chris Smith: "Re: Is perl better? :((("
- Reply: Chris Smith: "Re: Is perl better? :((("
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|