📄 program.so
字号:
m4_comment([$Id: program.so,v 10.35 2004/09/10 13:04:01 bostic Exp $])m4_ref_title(Java API, Java programming notes,, java/compat, java/faq)dnl #################################################################dnl This whole page is Java.dnl #################################################################pushdef([M4API], JAVA_API)m4_p([dnlAlthough the Java API parallels the m4_db C++/C interface in many ways,it differs where the Java language requires. For example, the handlemethod names are camel-cased and conform to Java naming patterns. (TheC++/C method names are currently provided, but are deprecated.)])m4_nlistbeginm4_nlist([dnlThe Java runtime does not automatically close m4_db objects onfinalization. There are several reasons for this. One is thatfinalization is generally run only when garbage collection occurs, andthere is no guarantee that this occurs at all, even on exit. Allowingspecific m4_db actions to occur in ways that cannot be replicated seemswrong. Second, finalization of objects may happen in an arbitraryorder, so we would have to do extra bookkeeping to make sure thateverything was closed in the proper order. The best word of advice isto always do a close() for any matching open() call. Specifically, them4_db package requires that you explicitly call close on each individualm4_linkjavadoc(com.sleepycat.db, Database) andm4_linkjavadoc(com.sleepycat.db, Cursor) object that you opened. Your databaseactivity may not be synchronized to disk unless you do so.])m4_nlist([dnlSome methods in the Java API have no return type, and throw am4_linkjavadoc(com.sleepycat.db, DatabaseException) when an severe errorarises. There are some notable methods that do have a return value, andcan also throw an exception. The "get" methods inm4_linkjavadoc(com.sleepycat.db, Database) andm4_linkjavadoc(com.sleepycat.db, Cursor) both return 0 when a getsucceeds, m4_ref(DB_NOTFOUND) when the key is not found, and throw anerror when there is a severe error. This approach allows the programmerto check for typical data-driven errors by watching return valueswithout special casing exceptions.m4_p([dnlAn object of type m4_linkjavadoc(com.sleepycat.db, MemoryException) isthrown when a Dbt is too small to hold the corresponding key or data item.])m4_p([dnlAn object of type m4_linkjavadoc(com.sleepycat.db, DeadlockException) isthrown when a deadlock would occur.])m4_p([dnlAn object of type m4_linkjavadoc(com.sleepycat.db, RunRecoveryException), asubclass of m4_linkjavadoc(com.sleepycat.db, DatabaseException), is thrown whenthere is an error that requires a recovery of the database usingm4_ref(db_recover).])m4_p([dnlAn object of type m4_linkjavadoc(java.lang, IllegalArgumentException)a standard Java Language exception, is thrown when there is an error inmethod arguments.])m4_p([dnlAn object of type m4_linkjavadoc(java.lang, OutOfMemoryError) is thrownwhen the system cannot provide enough memory to complete the operation(the ENOMEM system error on UNIX).])])m4_nlist([dnlIf there are embedded nulls in the m4_arg(curslist) argument form4_linkjavadoc(com.sleepycat.db, Database, [join(com.sleepycat.db.Cursor__BRACKETS__, com.sleepycat.db.JoinConfig)]),they will be treated as the end of the list of cursors, even if youmay have allocated a longer array. Fill in all the cursors in yourarray unless you intend to cut it short.])m4_nlist([dnlIf you are using custom class loaders in your application, make surethat the m4_db classes are loaded by the system class loader, not acustom class loader. This is due to a JVM bug that can cause an accessviolation during finalization (see the bug 4238486 in Sun Microsystem'sJava Bug Database).])m4_nlistenddnl #################################################################dnl This whole page is Java.dnl #################################################################popdef([M4API])m4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -