Hello Harish,
I have a few more queries (already mailed to EJB mailing List) which can u
please answer them. Well correct me if i am wrong.
1. I thought the cursors get open only after a we fire a query resulting in
some records being obtained. Now do the cursor also gets open just by
preparing a statement?
2. Also if i opt to do ResultSet.Close() and not Statement.Close() then the
cursor will still get closed or still remain open until Statement.close() is
executed?
Thanking you in advance.
Regards,
Prateek.
Regards,
Prateek.
----- Original Message -----
From: Harish S K <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 10, 2000 1:16 AM
Subject: Re: Max Open Cursors Exceeded
> You must close the Statement too.
>
> -----Original Message-----
> From: Prateek Asthana [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, November 11, 2000 12:01 AM
> To: [EMAIL PROTECTED]
> Subject: Max Open Cursors Exceeded
>
>
> Hello Friends,
> I am getting Max Open Cursors Exceeded Exception. I am making and
> closing Connections to my Oracle database from my Session Bean. The code
> is
> given below:
>
> func()
> {
> conn = ds.getConnection();
> conn.setAutoCommit(false);
> Statement stmt;
> try
> {
> stmt = conn.createStatement();
> stmt.executeUpdate(sql);
> }
> catch (Exception sql_ex)
> {
> conn.close();
> }
>
> try
> {
> conn.close();
> }
> catch (Exception conn_ex)
> {
> }
> }
>
> Now as seen above I am not closing my Statement object by doing
> stmt.close(). Also in some other section of my program i am obtaining a
> Result Set. But at the end I am only closing the Connection and not
> closing
> the ResultSet. Will this lead to Max Open Cursors Exceeded Exception? Is
> it
> not that only closing the Connection Object by calling conn.close() even
> closes the cursors.
>
> Thanking in advance.
>
> Regards,
> Prateek
>
> ========================================================================
> ===
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".