1<!--$Id: dbc_close.so,v 10.35 2006/10/24 13:26:50 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: Dbc::close</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>Dbc::close</b> 14</td> 15<td align=right> 16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25Dbc::close(void); 26</pre></b> 27<hr size=1 noshade> 28<b>Description: Dbc::close</b> 29<p>The Dbc::close method discards the cursor.</p> 30<p>It is possible for the Dbc::close method to return 31<a href="../ref/program/errorret.html#DB_LOCK_DEADLOCK">DB_LOCK_DEADLOCK</a>, signaling that any enclosing transaction should 32be aborted. If the application is already intending to abort the 33transaction, this error should be ignored, and the application should 34proceed.</p> 35<p>After Dbc::close has been called, regardless of its return, the 36cursor handle may not be used again.</p> 37<p>The Dbc::close method 38either returns a non-zero error value 39or throws an exception that encapsulates a non-zero error value on 40failure, and returns 0 on success. 41</p> 42<br><b>Errors</b> 43<p>The Dbc::close method 44may fail and throw 45<a href="../api_cxx/except_class.html">DbException</a>, 46encapsulating one of the following non-zero errors, or return one of 47the following non-zero errors:</p> 48<br> 49<b>EINVAL</b><ul compact><li>If the cursor is already closed; or if an 50invalid flag value or parameter was specified.</ul> 51<br> 52<p>If a transactional database environment operation was selected to 53resolve a deadlock, the Dbc::close method will fail and 54either return <a href="../ref/program/errorret.html#DB_LOCK_DEADLOCK">DB_LOCK_DEADLOCK</a> or 55throw a <a href="../api_cxx/deadlock_class.html">DbDeadlockException</a> exception.</p> 56<p>If a Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable 57to grant a lock in the allowed time, the Dbc::close method will fail and 58either return <a href="../ref/program/errorret.html#DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> or 59throw a <a href="../api_cxx/lockng_class.html">DbLockNotGrantedException</a> exception.</p> 60<hr size=1 noshade> 61<br><b>Class</b> 62<a href="../api_cxx/dbc_class.html">Dbc</a> 63<br><b>See Also</b> 64<a href="../api_cxx/dbc_list.html">Database Cursors and Related Methods</a> 65</tt> 66<table width="100%"><tr><td><br></td><td align=right> 67<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 68</td></tr></table> 69<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 70</body> 71</html> 72