Class BoxStore
- All Implemented Interfaces:
Closeable,AutoCloseable
Boxes to put and get objects of specific entity classes
(see boxFor(Class)). To get an instance of this class use MyObjectBox.builder().-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ThreadLocal<Transaction> Set when running inside TXprivate final int[]private final Stringprivate final org.greenrobot.essentials.collections.LongHashMap<Class<?>> private boolean(package private) intprivate static ObjectOn Android used for native library loading.(package private) final boolean(package private) final boolean(package private) final booleanprivate static BoxStoreprivate final Fileprivate final TxCallback<?> private longReference to the native store.static final StringPrefix supplied with database directory to signal a file-less and in-memory database should be used.static final StringReLinker uses this as a suffix for the extracted shared library file.private intprivate final ObjectClassPublisherCurrently used DB dirs with values fromgetCanonicalPath(File).private static Threadprivate final Map<Class<?>, EntityInfo<?>> private final intprivate static Objectprivate SyncClientKeeps a reference so the library user does not have to.private final ExecutorServiceprivate final Set<Transaction> (package private) final Objectprivate static final StringThe native or core version of ObjectBox the Java library is known to work with. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInternal, low level method: userunInReadTx(Runnable)instead.beginTx()Internal, low level method: userunInTx(Runnable)instead.<T> Box<T> Returns a Box for the given type.<T> TcallInReadTx(Callable<T> callable) Calls the given callable inside a read(-only) transaction.<T> TcallInReadTxWithRetry(Callable<T> callable, int attempts, int initialBackOffInMs, boolean logAndHeal) CallscallInReadTx(Callable)and retries in case a DbException is thrown.<R> RLikerunInTx(Runnable), but allows returning a value and throwing an exception.<R> voidcallInTxAsync(Callable<R> callable, TxCallback<R> callback) Runs the given Runnable as a transaction in a separate thread.<R> RcallInTxNoException(Callable<R> callable) LikecallInTx(Callable), but throws no Exception.private voidVerifies this has not beenclosed.private voiddump thread stacks if pool does not terminate promptly.intstatic booleanClears the convenience instance.voidclose()Closes this BoxStore and releases associated resources.voidCall this method from a thread that is about to be shutdown or likely not to use ObjectBox anymore: it frees any cached resources tied to the calling thread (e.g.booleanDanger zone! This will delete all data (files) of this BoxStore! You must callclose()before and read the docs of that method carefully!static booleandeleteAllFiles(File objectStoreDirectory) Danger zone! This will delete all files in the given directory!static booleandeleteAllFiles(File baseDirectoryOrNull, String customDbNameOrNull) Danger zone! This will delete all files in the given directory!static booleandeleteAllFiles(Object androidContext, String customDbNameOrNull) Danger zone! This will delete all files in the given directory!diagnose()Gives info that can be useful for debugging.protected voidfinalize()Closes this if this is finalized.Collection<Class<?>> (package private) int[](package private) static StringgetCanonicalPath(File directory) static Object(package private) StringlongGet the size of this store.longThe size in bytes occupied by the database on disk (if any).static BoxStoreConvenience singleton instance which gets set up usingBoxStoreBuilder.buildDefault().(package private) Class<?> getEntityClassOrThrow(int entityTypeId) (package private) <T> EntityInfo<T> getEntityInfo(Class<T> entityClass) (package private) IntegergetEntityTypeId(Class<?> entityClass) intgetEntityTypeIdOrThrow(Class<?> entityClass) longGets the reference to the native store.intstatic ObjectReturns theSyncClientassociated with this store.static StringGets the Version of ObjectBox Java.static StringGets the Version of ObjectBox Core.private booleanReturns iftransactionshas a single transaction thatisActive().static booleanhasFeature(Feature feature) TxCallback<?> intFuture<?> internalScheduleThread(Runnable runnable) booleanisClosed()If this wasclosed.static booleanisDatabaseOpen(File directory) Using a directory, as configured withBoxStoreBuilder.directory(File), checks if the associated database files are in use by a BoxStore instance.static booleanisDatabaseOpen(File baseDirectoryOrNull, String dbNameOrNull) Using an optional base directory, as configured withBoxStoreBuilder.baseDirectory(File), and an optional database name, as configured withBoxStoreBuilder.name(String), checks if the associated database files are in use by a BoxStore instance.static booleanisDatabaseOpen(Object context, String dbNameOrNull) Using an Android Context and an optional database name, as configured withBoxStoreBuilder.name(String), checks if the associated database files are in use by a BoxStore instance.boolean(package private) static booleanisFileOpen(String canonicalPath) Also retries up to 500ms to improve GC race condition situation.(package private) static booleanisFileOpenSync(String canonicalPath, boolean runFinalization) booleanFor internal use only.static booleanbooleanbooleanWhether the store was created using read-only mode.static booleanstatic boolean(package private) static longnativeBeginReadTx(long store) (package private) static longnativeBeginTx(long store) (package private) static intnativeCleanStaleReadTransactions(long store) (package private) static longnativeCreateWithFlatOptions(byte[] options, byte[] model) Creates a native BoxStore instance with FlatBufferFlatStoreOptionsoptionsand aModelBuildermodel.(package private) longnativeDbSize(long store) (package private) longnativeDbSizeOnDisk(long store) (package private) static voidnativeDelete(long store) (package private) static StringnativeDiagnose(long store) (package private) static voidnativeDropAllData(long store) (package private) static String(package private) static longA static counter for the alive entity types (entity schema instances); this can be useful to test against leaks.private static booleannativeHasFeature(int feature) (package private) static boolean(package private) static booleannativeIsReadOnly(long store) (package private) longnativePanicModeRemoveAllObjects(long store, int entityId) (package private) static voidnativeRegisterCustomType(long store, int entityId, int propertyId, String propertyName, Class<? extends PropertyConverter> converterClass, Class<?> customType) (package private) static intnativeRegisterEntityClass(long store, String entityName, Class<?> entityClass) (package private) static booleannativeRemoveDbFiles(String directory, boolean removeDir) (package private) static voidnativeSetDbExceptionListener(long store, DbExceptionListener dbExceptionListener) (package private) static voidnativeSetDebugFlags(long store, int debugFlags) private StringnativeStartObjectBrowser(long store, String urlPath, int port) private booleannativeStopObjectBrowser(long store) (package private) static long(package private) static long(package private) longnativeValidate(long store, long pageLimit, boolean checkLeafLevel) (package private) longpanicModeRemoveAllObjects(int entityId) voidRemoves all objects from all types ("boxes"), e.g.voidrunInReadTx(Runnable runnable) Runs the given runnable inside a read(-only) transaction.voidRuns the given runnable inside a transaction.voidrunInTxAsync(Runnable runnable, TxCallback<Void> callback) Runs the given Runnable as a transaction in a separate thread.voidsetDbExceptionListener(DbExceptionListener dbExceptionListener) Sets a listener that will be called when an exception is thrown.(package private) voidsetDebugFlags(int debugFlags) (package private) static voidsetDefault(BoxStore store) (package private) voidsetSyncClient(SyncClient syncClient) longDeprecated.startObjectBrowser(int port) startObjectBrowser(String urlToBindTo) booleanADataObservercan be subscribed to data changes using the returned builder.<T> SubscriptionBuilder<Class<T>> Likesubscribe(), but wires the supplied @DataObserveronly to the given object class for notifications.static longsysProcMeminfoKb(String key) Linux only: extracts a kB value from /proc/meminfo (system wide memory information).static longsysProcStatusKb(String key) Linux only: extracts a kB value from /proc/self/status (process specific information).(package private) voidtxCommitted(Transaction tx, int[] entityTypeIdsAffected) voidunregisterTransaction(Transaction transaction) longvalidate(long pageLimit, boolean checkLeafLevel) Validate database pages, a lower level storage unit (integrity check).(package private) static voidverifyNotAlreadyOpen(String canonicalPath) private void
-
Field Details
-
context
On Android used for native library loading. -
relinker
-
IN_MEMORY_PREFIX
Prefix supplied with database directory to signal a file-less and in-memory database should be used.- See Also:
-
JNI_VERSION
ReLinker uses this as a suffix for the extracted shared library file. If different, it will update it.- See Also:
-
VERSION
The native or core version of ObjectBox the Java library is known to work with.- See Also:
-
defaultStore
-
openFiles
Currently used DB dirs with values fromgetCanonicalPath(File). -
openFilesCheckerThread
-
directory
-
canonicalPath
-
handle
private volatile long handleReference to the native store. Should probably get throughgetNativeStore()instead. -
dbNameByClass
-
entityTypeIdByClass
-
propertiesByClass
-
classByEntityTypeId
-
allEntityTypeIds
private final int[] allEntityTypeIds -
boxes
-
transactions
-
threadPool
-
objectClassPublisher
-
debugTxRead
final boolean debugTxRead -
debugTxWrite
final boolean debugTxWrite -
debugRelations
final boolean debugRelations -
activeTx
Set when running inside TX -
closed
private volatile boolean closed -
txCommitCountLock
-
commitCount
volatile int commitCount -
objectBrowserPort
private int objectBrowserPort -
queryAttempts
private final int queryAttempts -
failedReadTxAttemptCallback
-
syncClient
Keeps a reference so the library user does not have to.
-
-
Constructor Details
-
BoxStore
BoxStore(BoxStoreBuilder builder)
-
-
Method Details
-
getContext
-
getRelinker
-
getDefault
Convenience singleton instance which gets set up usingBoxStoreBuilder.buildDefault().Note: for better testability, you can usually avoid singletons by storing a
BoxStoreinstance in some application scope object and pass it along. -
setDefault
-
clearDefaultStore
public static boolean clearDefaultStore()Clears the convenience instance.Note: This is usually not required (for testability, please see the comment of
getDefault()).- Returns:
- true if a default store was available before
-
getVersion
Gets the Version of ObjectBox Java. -
nativeGetVersion
-
getVersionNative
Gets the Version of ObjectBox Core. -
nativeRemoveDbFiles
- Returns:
- true if DB files did not exist or were successfully removed, false if DB files exist that could not be removed.
-
nativeCreateWithFlatOptions
static long nativeCreateWithFlatOptions(byte[] options, byte[] model) Creates a native BoxStore instance with FlatBufferFlatStoreOptionsoptionsand aModelBuildermodel. Returns the handle of the native store instance. -
nativeIsReadOnly
static boolean nativeIsReadOnly(long store) -
nativeDelete
static void nativeDelete(long store) -
nativeDropAllData
static void nativeDropAllData(long store) -
nativeGloballyActiveEntityTypes
A static counter for the alive entity types (entity schema instances); this can be useful to test against leaks. This number depends on the number of currently opened stores; no matter how often stores were closed and (re-)opened. E.g. when stores are regularly opened, but not closed by the user, the number should increase. When all stores are properly closed, this value should be 0. -
nativeBeginTx
static long nativeBeginTx(long store) -
nativeBeginReadTx
static long nativeBeginReadTx(long store) -
nativeRegisterEntityClass
- Returns:
- entity ID
-
nativeRegisterCustomType
static void nativeRegisterCustomType(long store, int entityId, int propertyId, String propertyName, Class<? extends PropertyConverter> converterClass, Class<?> customType) -
nativeDiagnose
-
nativeCleanStaleReadTransactions
static int nativeCleanStaleReadTransactions(long store) -
nativeSetDbExceptionListener
static void nativeSetDbExceptionListener(long store, @Nullable DbExceptionListener dbExceptionListener) -
nativeSetDebugFlags
static void nativeSetDebugFlags(long store, int debugFlags) -
nativeStartObjectBrowser
-
nativeStopObjectBrowser
private boolean nativeStopObjectBrowser(long store) -
nativeIsObjectBrowserAvailable
static boolean nativeIsObjectBrowserAvailable() -
nativeDbSize
long nativeDbSize(long store) -
nativeDbSizeOnDisk
long nativeDbSizeOnDisk(long store) -
nativeValidate
long nativeValidate(long store, long pageLimit, boolean checkLeafLevel) -
nativeSysProcMeminfoKb
-
nativeSysProcStatusKb
-
nativeHasFeature
private static boolean nativeHasFeature(int feature) -
hasFeature
-
isObjectBrowserAvailable
public static boolean isObjectBrowserAvailable() -
isSyncAvailable
public static boolean isSyncAvailable() -
isSyncServerAvailable
public static boolean isSyncServerAvailable() -
nativePanicModeRemoveAllObjects
long nativePanicModeRemoveAllObjects(long store, int entityId) -
getCanonicalPath
-
verifyNotAlreadyOpen
-
isFileOpen
Also retries up to 500ms to improve GC race condition situation. -
isFileOpenSync
-
isDatabaseOpen
public static boolean isDatabaseOpen(Object context, @Nullable String dbNameOrNull) throws IOException Using an Android Context and an optional database name, as configured withBoxStoreBuilder.name(String), checks if the associated database files are in use by a BoxStore instance.Use this to check that database files are not open before copying or deleting them.
- Throws:
IOException
-
isDatabaseOpen
public static boolean isDatabaseOpen(@Nullable File baseDirectoryOrNull, @Nullable String dbNameOrNull) throws IOException Using an optional base directory, as configured withBoxStoreBuilder.baseDirectory(File), and an optional database name, as configured withBoxStoreBuilder.name(String), checks if the associated database files are in use by a BoxStore instance.Use this to check that database files are not open before copying or deleting them.
- Throws:
IOException
-
isDatabaseOpen
Using a directory, as configured withBoxStoreBuilder.directory(File), checks if the associated database files are in use by a BoxStore instance.Use this to check that database files are not open before copying or deleting them.
- Throws:
IOException
-
sysProcMeminfoKb
Linux only: extracts a kB value from /proc/meminfo (system wide memory information). A couple of interesting keys (from 'man proc'): - MemTotal: Total usable RAM (i.e., physical RAM minus a few reserved bits and the kernel binary code). - MemFree: The sum of LowFree+HighFree. - MemAvailable: An estimate of how much memory is available for starting new applications, without swapping.- Parameters:
key- The string identifying the wanted line from /proc/meminfo to extract a Kb value from. E.g. "MemTotal".- Returns:
- Kb value or 0 on failure
-
sysProcStatusKb
Linux only: extracts a kB value from /proc/self/status (process specific information). A couple of interesting keys (from 'man proc'): - VmPeak: Peak virtual memory size. - VmSize: Virtual memory size. - VmHWM: Peak resident set size ("high water mark"). - VmRSS: Resident set size. Note that the value here is the sum of RssAnon, RssFile, and RssShmem. - RssAnon: Size of resident anonymous memory. (since Linux 4.5). - RssFile: Size of resident file mappings. (since Linux 4.5). - RssShmem: Size of resident shared memory (includes System V shared memory, mappings from tmpfs(5), and shared anonymous mappings). (since Linux 4.5). - VmData, VmStk, VmExe: Size of data, stack, and text segments. - VmLib: Shared library code size.- Parameters:
key- The string identifying the wanted line from /proc/self/status to extract a Kb value from. E.g. "VmSize".- Returns:
- Kb value or 0 on failure
-
sizeOnDisk
Deprecated.UsegetDbSize()orgetDbSizeOnDisk()instead which properly handle in-memory databases.The size in bytes occupied by the data file on disk.- Returns:
- 0 if the size could not be determined (does not throw unless this store was already closed)
-
getDbSize
public long getDbSize()Get the size of this store. For a disk-based store type, this corresponds to the size on disk, and for the in-memory store type, this is roughly the used memory bytes occupied by the data.- Returns:
- The size in bytes of the database, or 0 if the file does not exist or some error occurred.
-
getDbSizeOnDisk
public long getDbSizeOnDisk()The size in bytes occupied by the database on disk (if any).- Returns:
- The size in bytes of the database on disk, or 0 if the underlying database is in-memory only or the size could not be determined.
-
finalize
Closes this if this is finalized.Explicitly call
close()instead to avoid expensive finalization. -
checkOpen
private void checkOpen()Verifies this has not beenclosed. -
getDbName
-
getEntityTypeId
-
getEntityTypeIdOrThrow
-
getAllEntityClasses
-
getAllEntityTypeIds
-
getEntityClassOrThrow
-
getEntityInfo
-
beginTx
Internal, low level method: userunInTx(Runnable)instead. -
beginReadTx
Internal, low level method: userunInReadTx(Runnable)instead. Begins a transaction for read access only. Note: there may be only one read transaction per thread. -
isClosed
public boolean isClosed()If this wasclosed. -
isReadOnly
public boolean isReadOnly()Whether the store was created using read-only mode. If true the schema is not updated and write transactions are not possible. -
close
public void close()Closes this BoxStore and releases associated resources.Before calling, all database operations must have finished (there are no more active transactions).
If that is not the case, the method will briefly wait on any active transactions, but then will forcefully close them to avoid crashes and print warning messages ("Transactions are still active"). If this occurs, analyze your code to make sure all database operations, notably in other threads or data observers, are properly finished.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
checkThreadTermination
private void checkThreadTermination()dump thread stacks if pool does not terminate promptly. -
deleteAllFiles
public boolean deleteAllFiles()Danger zone! This will delete all data (files) of this BoxStore! You must callclose()before and read the docs of that method carefully!A safer alternative: use the static
deleteAllFiles(File)method before opening the BoxStore.- Returns:
- true if the directory 1) was deleted successfully OR 2) did not exist in the first place. Note: If false is returned, any number of files may have been deleted before the failure happened.
-
deleteAllFiles
Danger zone! This will delete all files in the given directory!No
BoxStoremay be alive using the given directory. E.g. call this before building a store. When calling this afterclosinga store, read the docs of that method carefully first!If no
namewas specified when building the store, use like:BoxStore.deleteAllFiles(new File(BoxStoreBuilder.DEFAULT_NAME));For an
in-memorydatabase, this will just clean up the in-memory database.- Parameters:
objectStoreDirectory- directory to be deleted; this is the value you previously provided toBoxStoreBuilder.directory(File)- Returns:
- true if the directory 1) was deleted successfully OR 2) did not exist in the first place. Note: If false is returned, any number of files may have been deleted before the failure happened.
- Throws:
IllegalStateException- if the given directory is still used by an openBoxStore.
-
deleteAllFiles
Danger zone! This will delete all files in the given directory!No
BoxStoremay be alive using the given name.If you did not use a custom name with BoxStoreBuilder, you can pass "new File(
BoxStoreBuilder.DEFAULT_NAME)".- Parameters:
androidContext- provide an Android Context like Application or ServicecustomDbNameOrNull- use null for default name, or the name you previously provided toBoxStoreBuilder.name(String).- Returns:
- true if the directory 1) was deleted successfully OR 2) did not exist in the first place. Note: If false is returned, any number of files may have been deleted before the failure happened.
- Throws:
IllegalStateException- if the given name is still used by a openBoxStore.
-
deleteAllFiles
public static boolean deleteAllFiles(@Nullable File baseDirectoryOrNull, @Nullable String customDbNameOrNull) Danger zone! This will delete all files in the given directory!No
BoxStoremay be alive using the given directory.If you did not use a custom name with BoxStoreBuilder, you can pass "new File(
BoxStoreBuilder.DEFAULT_NAME)".- Parameters:
baseDirectoryOrNull- use null for no base dir, or the value you previously provided toBoxStoreBuilder.baseDirectory(File)customDbNameOrNull- use null for default name, or the name you previously provided toBoxStoreBuilder.name(String).- Returns:
- true if the directory 1) was deleted successfully OR 2) did not exist in the first place. Note: If false is returned, any number of files may have been deleted before the failure happened.
- Throws:
IllegalStateException- if the given directory (+name) is still used by a openBoxStore.
-
removeAllObjects
public void removeAllObjects()Removes all objects from all types ("boxes"), e.g. deletes all database content (excluding meta data like the data model). This typically performs very quickly (e.g. faster thanBox.removeAll()).Note that this does not reclaim disk space: the already reserved space for the DB file(s) is used in the future resulting in better performance because no/less disk allocation has to be done.
If you want to reclaim disk space, delete the DB file(s) instead:
close()the BoxStore (and ensure that no thread access it)deleteAllFiles()of the BoxStore- Open a new BoxStore
-
unregisterTransaction
-
hasActiveTransaction
private boolean hasActiveTransaction()Returns iftransactionshas a single transaction thatisActive().Callers must synchronize on
transactions. -
txCommitted
-
boxFor
Returns a Box for the given type. Objects are put into (and get from) their individual Box.Creates a Box only once and then always returns the cached instance.
-
runInTx
Runs the given runnable inside a transaction.Efficiency notes: it is advised to run multiple puts in a transaction because each commit requires an expensive disk synchronization.
-
runInReadTx
Runs the given runnable inside a read(-only) transaction. Multiple read transactions can occur at the same time. This allows multiple read operations (gets) using a single consistent state of data. Also, for a high number of read operations (thousands, e.g. in loops), it is advised to run them in a single read transaction for efficiency reasons. -
callInReadTxWithRetry
@Experimental public <T> T callInReadTxWithRetry(Callable<T> callable, int attempts, int initialBackOffInMs, boolean logAndHeal) CallscallInReadTx(Callable)and retries in case a DbException is thrown. If the given amount of attempts is reached, the last DbException will be thrown. Experimental: API might change. -
callInReadTx
Calls the given callable inside a read(-only) transaction. Multiple read transactions can occur at the same time. This allows multiple read operations (gets) using a single consistent state of data. Also, for a high number of read operations (thousands, e.g. in loops), it is advised to run them in a single read transaction for efficiency reasons. Note that an exception thrown by the given Callable will be wrapped in a RuntimeException, if the exception is not a RuntimeException itself. -
callInTx
LikerunInTx(Runnable), but allows returning a value and throwing an exception.- Throws:
Exception
-
callInTxNoException
LikecallInTx(Callable), but throws no Exception. Any Exception thrown in the Callable is wrapped in a RuntimeException. -
runInTxAsync
Runs the given Runnable as a transaction in a separate thread. Once the transaction completes the given callback is called (callback may be null).See also
runInTx(Runnable). -
callInTxAsync
Runs the given Runnable as a transaction in a separate thread. Once the transaction completes the given callback is called (callback may be null).* See also
callInTx(Callable). -
diagnose
Gives info that can be useful for debugging.- Returns:
- String that is typically logged by the application.
-
validate
Validate database pages, a lower level storage unit (integrity check). Do not call this inside a transaction (currently unsupported).- Parameters:
pageLimit- the maximum of pages to validate (e.g. to limit time spent on validation). Pass zero set no limit and thus validate all pages.checkLeafLevel- Flag to validate leaf pages. These do not point to other pages but contain data.- Returns:
- Number of pages validated, which may be twice the given pageLimit as internally there are "two DBs".
- Throws:
DbException- if validation failed to run (does not tell anything about DB file consistency).FileCorruptException- if the DB file is actually inconsistent (corrupt).
-
cleanStaleReadTransactions
public int cleanStaleReadTransactions() -
closeThreadResources
public void closeThreadResources()Call this method from a thread that is about to be shutdown or likely not to use ObjectBox anymore: it frees any cached resources tied to the calling thread (e.g. readers). This method callsBox.closeThreadResources()for all initiated boxes (boxFor(Class)). -
subscribe
ADataObservercan be subscribed to data changes using the returned builder. The observer is supplied viaSubscriptionBuilder.observer(DataObserver)and will be notified once a transaction is committed and will receive changes to any object class.Threading notes: All observers are notified from one separate thread (pooled). Observers are not notified in parallel. The notification order is the same as the subscription order, although this may not always be guaranteed in the future.
Note that failed or aborted transaction do not trigger observers.
-
subscribe
Likesubscribe(), but wires the supplied @DataObserveronly to the given object class for notifications. -
startObjectBrowser
-
startObjectBrowser
-
startObjectBrowser
-
stopObjectBrowser
-
getObjectBrowserPort
-
isObjectBrowserRunning
public boolean isObjectBrowserRunning() -
verifyObjectBrowserNotRunning
private void verifyObjectBrowserNotRunning() -
setDbExceptionListener
Sets a listener that will be called when an exception is thrown. Replaces a previously set listener. Set tonullto remove the listener.This for example allows central error handling or special logging for database-related exceptions.
-
internalScheduleThread
-
internalThreadPool
-
isDebugRelations
-
internalQueryAttempts
-
internalFailedReadTxAttemptCallback
-
setDebugFlags
void setDebugFlags(int debugFlags) -
panicModeRemoveAllObjects
long panicModeRemoveAllObjects(int entityId) -
getNativeStore
public long getNativeStore()Gets the reference to the native store. Can be used with the C API to use the same store, e.g. via JNI, by passing it on toobx_store_wrap().Throws if the store is closed.
The procedure is like this:
1) you create a BoxStore on the Java side
2) you call this method to get the native store pointer
3) you pass the native store pointer to your native code (e.g. via JNI)
4) your native code calls obx_store_wrap() with the native store pointer to get a OBX_store pointer
5) Using the OBX_store pointer, you can use the C API.Note: Once you
close()this BoxStore, do not use it from the C API. -
isNativeStoreClosed
For internal use only. This API might change or be removed with a future release.Returns if the native Store was closed.
This is
trueshortly afterclose()was called andisClosed()returnstrue. -
getSyncClient
Returns theSyncClientassociated with this store. To create one seeSync. -
setSyncClient
-
getDbSize()orgetDbSizeOnDisk()instead which properly handle in-memory databases.