Quantcast

Do you need to manually close a Oracle stored procedure cursor?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Do you need to manually close a Oracle stored procedure cursor?

raiden
When I called a stored procedure that returns that returns a cursor, I found that I have to leave the cursor open so it can be accessed with mybatis. I wonder if I need to manually close the cursor after I am finished with it or is it automatically closed Mybatis or Oracle?

Thanks a lot.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Do you need to manually close a Oracle stored procedure cursor?

Guy Rouillier-2
Depends on how you use it.  Normally, you would supply a resultMap in your mapper.  In that case, MyBatis will automatically utilize the returned cursor to populate the linked resultMap, and close the cursor for you.  However, if you don't do this and return the raw ResultSet to your code and your code manually processes the ResultSet (rs.next(), etc.), then yes, you are are responsible for closing the ResultSet.

--
Guy Rouillier



------ Original Message ------
From: "raiden" <[hidden email]>
To: "mybatis-user" <[hidden email]>
Sent: 2/12/2017 1:55:45 AM
Subject: Do you need to manually close a Oracle stored procedure cursor?

When I called a stored procedure that returns that returns a cursor, I found that I have to leave the cursor open so it can be accessed with mybatis. I wonder if I need to manually close the cursor after I am finished with it or is it automatically closed Mybatis or Oracle?

Thanks a lot.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Do you need to manually close a Oracle stored procedure cursor?

raiden
Very helpful thanks!

On Sunday, February 12, 2017 at 3:21:12 PM UTC+8, Guy Rouillier wrote:
Depends on how you use it.  Normally, you would supply a resultMap in your mapper.  In that case, MyBatis will automatically utilize the returned cursor to populate the linked resultMap, and close the cursor for you.  However, if you don't do this and return the raw ResultSet to your code and your code manually processes the ResultSet (rs.next(), etc.), then yes, you are are responsible for closing the ResultSet.

--
Guy Rouillier



------ Original Message ------
From: "raiden" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nLkOCgj3BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fxkil...@...>
To: "mybatis-user" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nLkOCgj3BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@...>
Sent: 2/12/2017 1:55:45 AM
Subject: Do you need to manually close a Oracle stored procedure cursor?

When I called a stored procedure that returns that returns a cursor, I found that I have to leave the cursor open so it can be accessed with mybatis. I wonder if I need to manually close the cursor after I am finished with it or is it automatically closed Mybatis or Oracle?

Thanks a lot.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="nLkOCgj3BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



<a href="https://www.avast.com/antivirus" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fantivirus\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKLvnpDv0lgK5pU3VEfIU9tx2wrg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fantivirus\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKLvnpDv0lgK5pU3VEfIU9tx2wrg&#39;;return true;"> Avast logo

This email has been checked for viruses by Avast antivirus software.
<a href="https://www.avast.com/antivirus" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fantivirus\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKLvnpDv0lgK5pU3VEfIU9tx2wrg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fantivirus\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKLvnpDv0lgK5pU3VEfIU9tx2wrg&#39;;return true;">www.avast.com


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...