1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (build 1.6.0_23) on Fri May 11 14:10:06 EDT 2012 -->
7 Sequence (Oracle - Berkeley DB Java API)
10 <META NAME="date" CONTENT="2012-05-11">
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style">
14 <SCRIPT type="text/javascript">
15 function windowTitle()
17 if (location.href.indexOf('is-external=true') == -1) {
18 parent.document.title="Sequence (Oracle - Berkeley DB Java API)";
27 <BODY BGCOLOR="white" onload="windowTitle();">
31 <!-- ========= START OF TOP NAVBAR ======= -->
32 <A NAME="navbar_top"><!-- --></A>
33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37 <A NAME="navbar_top_firstrow"><!-- --></A>
38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39 <TR ALIGN="center" VALIGN="top">
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Sequence.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52 <b>Berkeley DB</b><br><font size="-1"> version 5.3.21</font></EM>
57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58 <A HREF="../../../com/sleepycat/db/SecondaryMultiKeyCreator.html" title="interface in com.sleepycat.db"><B>PREV CLASS</B></A>
59 <A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61 <A HREF="../../../index.html?com/sleepycat/db/Sequence.html" target="_top"><B>FRAMES</B></A>
62 <A HREF="Sequence.html" target="_top"><B>NO FRAMES</B></A>
63 <SCRIPT type="text/javascript">
66 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
71 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
84 <A NAME="skip-navbar_top"></A>
85 <!-- ========= END OF TOP NAVBAR ========= -->
88 <!-- ======== START OF CLASS DATA ======== -->
91 com.sleepycat.db</FONT>
95 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.db.Sequence</B>
100 <DT><PRE>public class <B>Sequence</B><DT>extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
104 A Sequence handle is used to manipulate a sequence record in a database.
105 Sequence handles are opened using the <A HREF="../../../com/sleepycat/db/Database.html#openSequence(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.SequenceConfig)"><CODE>Database.openSequence</CODE></A> method.
113 <!-- ========== METHOD SUMMARY =========== -->
115 <A NAME="method_summary"><!-- --></A>
116 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
117 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
118 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
119 <B>Method Summary</B></FONT></TH>
121 <TR BGCOLOR="white" CLASS="TableRowColor">
122 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
123 <CODE> void</CODE></FONT></TD>
124 <TD><CODE><B><A HREF="../../../com/sleepycat/db/Sequence.html#close()">close</A></B>()</CODE>
127 Close a sequence.</TD>
129 <TR BGCOLOR="white" CLASS="TableRowColor">
130 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
131 <CODE> long</CODE></FONT></TD>
132 <TD><CODE><B><A HREF="../../../com/sleepycat/db/Sequence.html#get(com.sleepycat.db.Transaction, int)">get</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn,
133 int delta)</CODE>
136 Return the next available element in the sequence and changes the sequence
137 value by <code>delta</code>.</TD>
139 <TR BGCOLOR="white" CLASS="TableRowColor">
140 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
141 <CODE> <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></CODE></FONT></TD>
142 <TD><CODE><B><A HREF="../../../com/sleepycat/db/Sequence.html#getDatabase()">getDatabase</A></B>()</CODE>
145 Return the Database handle associated with this sequence.</TD>
147 <TR BGCOLOR="white" CLASS="TableRowColor">
148 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
149 <CODE> <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A></CODE></FONT></TD>
150 <TD><CODE><B><A HREF="../../../com/sleepycat/db/Sequence.html#getKey()">getKey</A></B>()</CODE>
153 Return the DatabaseEntry used to open this sequence.</TD>
155 <TR BGCOLOR="white" CLASS="TableRowColor">
156 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
157 <CODE> <A HREF="../../../com/sleepycat/db/SequenceStats.html" title="class in com.sleepycat.db">SequenceStats</A></CODE></FONT></TD>
158 <TD><CODE><B><A HREF="../../../com/sleepycat/db/Sequence.html#getStats(com.sleepycat.db.StatsConfig)">getStats</A></B>(<A HREF="../../../com/sleepycat/db/StatsConfig.html" title="class in com.sleepycat.db">StatsConfig</A> config)</CODE>
161 Return statistical information about the sequence.</TD>
164 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
165 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
166 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
167 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
169 <TR BGCOLOR="white" CLASS="TableRowColor">
170 <TD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
176 <!-- ============ METHOD DETAIL ========== -->
178 <A NAME="method_detail"><!-- --></A>
179 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
180 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
181 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
182 <B>Method Detail</B></FONT></TH>
186 <A NAME="close()"><!-- --></A><H3>
189 public void <B>close</B>()
190 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
192 <DD>Close a sequence. Any unused cached values are lost.
194 The sequence handle may not be used again after this method has been
195 called, regardless of the method's success or failure.
202 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL>
207 <A NAME="get(com.sleepycat.db.Transaction, int)"><!-- --></A><H3>
210 public long <B>get</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn,
212 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
214 <DD>Return the next available element in the sequence and changes the sequence
215 value by <code>delta</code>. The value of <code>delta</code> must be
216 greater than zero. If there are enough cached values in the sequence
217 handle then they will be returned. Otherwise the next value will be
218 fetched from the database and incremented (decremented) by enough to cover
219 the <code>delta</code> and the next batch of cached values.
221 The <code>txn</code> handle must be null if the sequence handle was opened
222 with a non-zero cache size.
224 For maximum concurrency, a non-zero cache size should be specified prior to
225 opening the sequence handle, the <code>txn</code> handle should be
226 <code>null</code>, and <A HREF="../../../com/sleepycat/db/SequenceConfig.html#setAutoCommitNoSync(boolean)"><CODE>SequenceConfig.setAutoCommitNoSync</CODE></A> should
227 be called to disable log flushes.
231 <DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified, or null
232 may be specified to use auto-commit. For a non-transactional database, null
234 <p><DD><CODE>delta</CODE> - the amount by which to increment or decrement the sequence
236 <DT><B>Returns:</B><DD>the next available element in the sequence
238 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL>
243 <A NAME="getDatabase()"><!-- --></A><H3>
246 public <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A> <B>getDatabase</B>()
247 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
249 <DD>Return the Database handle associated with this sequence.
254 <DT><B>Returns:</B><DD>The Database handle associated with this sequence.
256 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL>
261 <A NAME="getKey()"><!-- --></A><H3>
264 public <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> <B>getKey</B>()
265 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
267 <DD>Return the DatabaseEntry used to open this sequence.
272 <DT><B>Returns:</B><DD>The DatabaseEntry used to open this sequence.
274 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL>
279 <A NAME="getStats(com.sleepycat.db.StatsConfig)"><!-- --></A><H3>
282 public <A HREF="../../../com/sleepycat/db/SequenceStats.html" title="class in com.sleepycat.db">SequenceStats</A> <B>getStats</B>(<A HREF="../../../com/sleepycat/db/StatsConfig.html" title="class in com.sleepycat.db">StatsConfig</A> config)
283 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
285 <DD>Return statistical information about the sequence.
287 In the presence of multiple threads or processes accessing an active
288 sequence, the information returned by this method may be out-of-date.
290 The getStats method cannot be transaction-protected. For this reason, it
291 should be called in a thread of control that has no open cursors or active
296 <DT><B>Parameters:</B><DD><CODE>config</CODE> - The statistics returned; if null, default statistics are returned.
298 <DT><B>Returns:</B><DD>Sequence statistics.
300 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL>
303 <!-- ========= END OF CLASS DATA ========= -->
307 <!-- ======= START OF BOTTOM NAVBAR ====== -->
308 <A NAME="navbar_bottom"><!-- --></A>
309 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
310 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
312 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
313 <A NAME="navbar_bottom_firstrow"><!-- --></A>
314 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
315 <TR ALIGN="center" VALIGN="top">
316 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
317 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
318 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
319 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Sequence.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
320 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
321 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
322 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
323 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
327 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
328 <b>Berkeley DB</b><br><font size="-1"> version 5.3.21</font></EM>
333 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
334 <A HREF="../../../com/sleepycat/db/SecondaryMultiKeyCreator.html" title="interface in com.sleepycat.db"><B>PREV CLASS</B></A>
335 <A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
336 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
337 <A HREF="../../../index.html?com/sleepycat/db/Sequence.html" target="_top"><B>FRAMES</B></A>
338 <A HREF="Sequence.html" target="_top"><B>NO FRAMES</B></A>
339 <SCRIPT type="text/javascript">
342 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
347 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
354 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
355 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
356 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
357 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
360 <A NAME="skip-navbar_bottom"></A>
361 <!-- ======== END OF BOTTOM NAVBAR ======= -->
364 <font size=1>Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved.</font>