Class COM.odi.ObjectStore

java.lang.Object
   |
   +----COM.odi.ObjectStore

public class ObjectStore
extends Object
The ObjectStore class defines system-level operations that are not specific to any database.


Variable Index

 o ALL_EXECUTE
File mode for all execute permission.
 o ALL_READ
File mode for all read permission.
 o ALL_WRITE
File mode for all write permission.
 o fileNativesIfAvailable
The argument to specify in a call to useFileNatives() when you want to use the file natives if it is possible to load the library containing them without error. Deprecated.
 o fileNativesNone
The argument to specify in a call to useFileNatives() when you do not want to use the native library. Deprecated.
 o fileNativesRequired
The argument to specify in a call to useFileNatives() when you want to use file natives and throw FatalApplicationException if the library containing them cannot be loaded. Deprecated.
 o GROUP_EXECUTE
File mode for group execute permission.
 o GROUP_READ
File mode for group read permission.
 o GROUP_WRITE
File mode for group write permission.
 o majorRelease
Use majorRelease() in place of this deprecated field. Deprecated.
 o minorRelease
Use minorRelease() in place of this deprecated field. Deprecated.
 o OBJECTSTORE
The whichProduct() method returns this value if you are running the Java interface to ObjectStore.
 o ObjectStoreEdition
Use OBJECTSTORE in place of this deprecated field. Deprecated.
 o OPEN_READONLY
Open mode for read-only.
 o OPEN_READONLY_NON_BLOCKING
Open mode for read-only, but don't block waiting for the database lock.
 o OPEN_UPDATE
Open mode for update.
 o OPEN_UPDATE_NON_BLOCKING
Open mode for update, but don't block waiting for the database lock.
 o OTHER_EXECUTE
File mode for other execute permission.
 o OTHER_READ
File mode for other read permission.
 o OTHER_WRITE
File mode for other write permission.
 o OWNER_EXECUTE
File mode for owner execute permission.
 o OWNER_READ
File mode for owner read permission.
 o OWNER_WRITE
File mode for owner write permission.
 o PSE
The whichProduct() method returns this value if you are running ObjectStore PSE/PSE Pro.
 o PSE_PRO
The whichProduct() method returns this value if you are running ObjectStore PSE Pro.
 o PSEEdition
Use PSE in place of thie deprecated field. Deprecated.
 o PSEProEdition
Use PSE_PRO in place of this deprecated field. Deprecated.
 o READONLY
The type value for a read-only transaction.
 o RETAIN_HOLLOW
The retain value when calling commit(int) or evict(Object, int) to maintain all persistent objects but evict their contents.
 o RETAIN_READONLY
The retain value when calling commit(int) or evict(Object, int) to maintain all persistent objects and retain their contents as well.
 o RETAIN_STALE
The retain value when calling commit(int) or evict(Object, int) to forget all persistent objects after the commit.
 o RETAIN_UPDATE
The retain value when calling commit(int) to maintain all persistent objects, retain their contents, and permit persistent objects to be modified between transactions.
 o UPDATE
The type value for an update transaction.

Method Index

 o destroy(Object)
Destroys a persistent object.
 o edition()
Use whichProduct() in place of this deprecated method. Deprecated.
 o evict(Object)
Evicts a persistent object.
 o evict(Object, int)
Evicts a persistent object.
 o evictAll(int)
Evicts all persistent objects by running the evict(Object, int) method on all persistent objects known to the session.
 o evictAndForget(Object)
The method evictAndForget() is a temporary device to deal with a limitation in version 1.0.2 of the JDK. Deprecated.
 o initialize(String, Properties)
Initializes PSE/PSE Pro, permitting the caller to use the rest of the API.
 o initialize(Thread)
Initializes PSE/PSE Pro and associates the calling thread with the targetThread.
 o isDestroyed(Object)
Determines whether the argument is destroyed.
 o isPersistent(Object)
Determines whether the argument is persistent.
 o isStale(Object)
Determines whether the argument is stale.
 o languageInterfaceMajorRelease()
Returns the major release of the Java language interface for PSE/PSE Pro that is running in the current thread.
 o languageInterfaceMinorRelease()
Returns the minor release of the Java language interface for PSE/PSE Pro that is running in the current thread.
 o languageInterfaceName()
Returns the name and release of the Java language interface for PSE/PSE Pro that is running in the current thread.
 o majorRelease()
Returns the major release version of PSE/PSE Pro for Java running in the current thread.
 o migrate(Object, Segment, boolean)
Moves a persistence-capable object into a database.
 o minorRelease()
Returns the minor release version of PSE/PSE Pro for Java running in the current thread.
 o productName()
Returns the product name and release of PSE/PSE Pro that is running in the current thread.
 o releaseName()
Use productName() in place of this deprecated method. Deprecated.
 o shutdown(boolean)
Shuts down PSE/PSE Pro for this thread.
 o storageSystemName()
Returns the name and release of the storage system for PSE/PSE Pro that is running in the current thread.
 o useFileNatives(int)
Deprecated.
 o whichProduct()
Returns a value that identifies the Object Design Java product that is running in the current thread.

Variables

 o majorRelease
  public static int majorRelease
Note: majorRelease is deprecated.

Use majorRelease() in place of this deprecated field.

See Also:
majorRelease
 o minorRelease
  public static int minorRelease
Note: minorRelease is deprecated.

Use minorRelease() in place of this deprecated field.

See Also:
minorRelease
 o PSE
  public final static int PSE
The whichProduct() method returns this value if you are running ObjectStore PSE/PSE Pro.

 o PSEEdition
  public final static int PSEEdition
Note: PSEEdition is deprecated.

Use PSE in place of thie deprecated field.

See Also:
PSE
 o PSE_PRO
  public final static int PSE_PRO
The whichProduct() method returns this value if you are running ObjectStore PSE Pro.

 o PSEProEdition
  public final static int PSEProEdition
Note: PSEProEdition is deprecated.

Use PSE_PRO in place of this deprecated field.

See Also:
PSE_PRO
 o OBJECTSTORE
  public final static int OBJECTSTORE
The whichProduct() method returns this value if you are running the Java interface to ObjectStore.

 o ObjectStoreEdition
  public final static int ObjectStoreEdition
Note: ObjectStoreEdition is deprecated.

Use OBJECTSTORE in place of this deprecated field.

See Also:
OBJECTSTORE
 o fileNativesNone
  public final static int fileNativesNone
Note: fileNativesNone is deprecated.

The argument to specify in a call to useFileNatives() when you do not want to use the native library.

See Also:
useFileNatives
 o fileNativesIfAvailable
  public final static int fileNativesIfAvailable
Note: fileNativesIfAvailable is deprecated.

The argument to specify in a call to useFileNatives() when you want to use the file natives if it is possible to load the library containing them without error.

See Also:
useFileNatives
 o fileNativesRequired
  public final static int fileNativesRequired
Note: fileNativesRequired is deprecated.

The argument to specify in a call to useFileNatives() when you want to use file natives and throw FatalApplicationException if the library containing them cannot be loaded.

See Also:
useFileNatives
 o RETAIN_STALE
  public final static int RETAIN_STALE
The retain value when calling commit(int) or evict(Object, int) to forget all persistent objects after the commit.

 o RETAIN_HOLLOW
  public final static int RETAIN_HOLLOW
The retain value when calling commit(int) or evict(Object, int) to maintain all persistent objects but evict their contents.

 o RETAIN_READONLY
  public final static int RETAIN_READONLY
The retain value when calling commit(int) or evict(Object, int) to maintain all persistent objects and retain their contents as well.

 o RETAIN_UPDATE
  public final static int RETAIN_UPDATE
The retain value when calling commit(int) to maintain all persistent objects, retain their contents, and permit persistent objects to be modified between transactions.

 o OWNER_READ
  public final static int OWNER_READ
File mode for owner read permission.

See Also:
create
 o OWNER_WRITE
  public final static int OWNER_WRITE
File mode for owner write permission.

See Also:
create
 o OWNER_EXECUTE
  public final static int OWNER_EXECUTE
File mode for owner execute permission.

See Also:
create
 o GROUP_READ
  public final static int GROUP_READ
File mode for group read permission.

See Also:
create
 o GROUP_WRITE
  public final static int GROUP_WRITE
File mode for group write permission.

See Also:
create
 o GROUP_EXECUTE
  public final static int GROUP_EXECUTE
File mode for group execute permission.

See Also:
create
 o OTHER_READ
  public final static int OTHER_READ
File mode for other read permission.

See Also:
create
 o OTHER_WRITE
  public final static int OTHER_WRITE
File mode for other write permission.

See Also:
create
 o OTHER_EXECUTE
  public final static int OTHER_EXECUTE
File mode for other execute permission.

See Also:
create
 o ALL_READ
  public final static int ALL_READ
File mode for all read permission.

See Also:
create
 o ALL_WRITE
  public final static int ALL_WRITE
File mode for all write permission.

See Also:
create
 o ALL_EXECUTE
  public final static int ALL_EXECUTE
File mode for all execute permission.

See Also:
create
 o OPEN_UPDATE
  public final static int OPEN_UPDATE
Open mode for update.

See Also:
open
 o OPEN_READONLY
  public final static int OPEN_READONLY
Open mode for read-only.

See Also:
open
 o OPEN_UPDATE_NON_BLOCKING
  public final static int OPEN_UPDATE_NON_BLOCKING
Open mode for update, but don't block waiting for the database lock.

See Also:
open
 o OPEN_READONLY_NON_BLOCKING
  public final static int OPEN_READONLY_NON_BLOCKING
Open mode for read-only, but don't block waiting for the database lock.

See Also:
open
 o READONLY
  public final static byte READONLY
The type value for a read-only transaction.

 o UPDATE
  public final static byte UPDATE
The type value for an update transaction.

Methods

 o majorRelease
  public static int majorRelease()
Returns the major release version of PSE/PSE Pro for Java running in the current thread.

Returns:
The major release of PSE.
Throws: ObjectStoreException
If PSE/PSE Pro is not initialized for the current thread.
 o minorRelease
  public static int minorRelease()
Returns the minor release version of PSE/PSE Pro for Java running in the current thread.

Returns:
The minor release of PSE/PSE Pro.
Throws: ObjectStoreException
If PSE/PSE Pro is not initialized for the current thread.
 o productName
  public static String productName()
Returns the product name and release of PSE/PSE Pro that is running in the current thread.

Returns:
The product name and release of PSE/PSE Pro.

Throws: ObjectStoreException
If PSE/PSE Pro is not initialized for the current thread.
 o releaseName
  public static String releaseName()
Note: releaseName() is deprecated.

Use productName() in place of this deprecated method.

See Also:
productName
 o whichProduct
  public static int whichProduct()
Returns a value that identifies the Object Design Java product that is running in the current thread.

Returns:
PSE if you are running PSE, PSE_PRO if you are running PSE Pro, OBJECTSTORE if you are running the Java interface to ObjectStore.
Throws: ObjectStoreException
If PSE/PSE Pro is not initialized for the current thread.
 o edition
  public static int edition()
Note: edition() is deprecated.

Use whichProduct() in place of this deprecated method.

See Also:
whichProduct
 o storageSystemName
  public static String storageSystemName()
Returns the name and release of the storage system for PSE/PSE Pro that is running in the current thread.

Returns:
The storage system name and release of PSE/PSE Pro.
Throws: ObjectStoreException
If PSE/PSE Pro is not initialized for the current thread.
 o languageInterfaceName
  public static String languageInterfaceName()
Returns the name and release of the Java language interface for PSE/PSE Pro that is running in the current thread.

Returns:
The language interface name and release of PSE/PSE Pro.
 o languageInterfaceMajorRelease
  public static int languageInterfaceMajorRelease()
Returns the major release of the Java language interface for PSE/PSE Pro that is running in the current thread.

Returns:
The language interface major release of PSE/PSE Pro.
 o languageInterfaceMinorRelease
  public static int languageInterfaceMinorRelease()
Returns the minor release of the Java language interface for PSE/PSE Pro that is running in the current thread.

Returns:
The language interface minor release of PSE/PSE Pro.
 o initialize
  public static boolean initialize(String host,
                                   Properties properties)
Initializes PSE/PSE Pro, permitting the caller to use the rest of the API.

If initialize() has not already been called for this thread, then this method

If initialize() has already been called for this thread then this method checks whether or not the host specified here is the same as the host that was specified in the original call to the initialize() method. If the hosts are equal or both null then this method returns false to indicate that it did not initialize PSE/PSE Pro. This is useful when you want to confirm that PSE/PSE Pro is initialized without performing any action. If the hosts are not equal, PSE/PSE Pro throws IllegalArgumentException.

The original call to initialize() and subsequent calls can specify a null argument for the host.

If you call this method on a thread that is cooperating with other threads, PSE/PSE Pro returns false to indicate that it has not done the initialization. PSE/PSE Pro does not make the calling thread an independent thread.

Parameters:
host - This parameter is ignored.

properties - A property list containing additional information needed to establish the connection with the server. Legal values are:
  • COM.odi.disableWeakLinks: This is a boolean value which defaults to false. If it is true the weak link functions in ObjectStore are disabled, even if they are available in the underlying virtual machine. Setting this to false causes weak link support to be used if it's available in the virtual machine. Currently, only Sun's JDK 1.1 has weak link support.
  • COM.odi.useDatabaseLocking: This is a boolean value which defaults to false. If it is true, then database locking is performed. This property is only recognized by PSE and PSE Pro.
  • COM.odi.useFsync: This is a boolean value which defaults to true. If it is false, disk buffers are not forced to disk from the underlying operating system buffers prior to commit. It is recommended that this be left at the default setting of true. This property is only recognized by PSE and PSE Pro.

Returns:
The true constant if an initialization was performed. The false constant if not.

Throws: FatalApplicationException
If you are running PSE and you already initialized PSE/PSE Pro in a thread that is still active and you try to initialize PSE/PSE Pro in an independent thread.
Throws: IllegalArgumentException
If you try to restart PSE/PSE Pro (call the initialize() method again) and the host that was originally specified and the host specified in the current call are not both null or not equal.
 o initialize
  public static boolean initialize(Thread targetThread)
Initializes PSE/PSE Pro and associates the calling thread with the targetThread. This makes the calling thread and the target thread cooperative threads and permits the caller to use the rest of the API.

Returns:
The true constant if the thread is joined to the target thread's session by this operation. This implies that the calling thread did not belong to a session before the call to initialize(). The false constant if the calling thread and target thread were already joined to the same session before the call to initialize().

Throws: ObjectStoreException
If PSE/PSE Pro is already initialized for the calling thread and the calling thread's session is not the same as the target thread's session. If you are using PSE, you would not see this exception because there can be only one session.
Throws: IllegalArgumentException
If the targetThread argument is null.
 o shutdown
  public static void shutdown(boolean force)
Shuts down PSE/PSE Pro for this thread. If PSE/PSE Pro has already been shut down for this thread, no further action is taken.

Parameters:
force - If true, perform the shutdown no matter how many other threads are cooperating with this thread. If false, disassociate this thread from any cooperating threads, but only shut down PSE/PSE Pro if there are no other cooperating threads.
 o destroy
  public static void destroy(Object object)
Destroys a persistent object. It is permissable to destroy an object that is referred to by other objects. If you do so, there are some issues to consider.

Parameters:
object - The object to be destroyed. If it is not persistent this method has no effect.

Throws: DatabaseNotOpenException
If the database containing the object to be destroyed is not open.
Throws: NoTransactionInProgressException
If there is no transaction in progress.
Throws: ObjectException
If the object being destroyed is a stale object.
Throws: ObjectNotFoundException
If the object was not found, either because the object itself, its segment, or its database were destroyed, or because the object was local and was fetched in a previous transaction.
Throws: ObjectStoreException
If PSE/PSE Pro is not initialized for the current thread or if the object is not associated with this thread.
Throws: UpdateReadOnlyException
If there is a read-only transaction in progress or if the database is open read-only.
 o migrate
  public static void migrate(Object object,
                             Segment segment,
                             boolean export)
Moves a persistence-capable object into a database. If the object is not already persistent, it is moved into the specified segment and exported if requested (if you are using ObjectStore DBMS). The object is made persistent regardless of whether or not it is reachable by transitive persistence. After this method has been invoked on the object, the object is effectively persistent and calling the Segment.of() method on the object returns the segment denoted by the segment argument.

If the object is already persistent, is in the segment specified, and is either exported or not exported as specified, the method does nothing. Otherwise, if the object is persistent, throws an exception.

Transitive persistence is the process of automatically migrating into a database those persistence-capable objects that are reachable from already persistent objects.

Parameters:
object - The object to migrate. It must be persistence-capable.

segment - The segment to migrate the object into. If this argument is null, PSE/PSE Pro throws IllegalArgumentException.

export - Export the object if true. This applies only if you are using the Java interface to ObjectStore Development Client.

Throws: DatabaseNotOpenException
If the database is not open.
Throws: IllegalArgumentException
If the object argument is null.
Throws: NoTransactionInProgressException
If there is no transaction in progress.
Throws: ObjectException
If export was specified in ObjectStore PSE or PSE Pro.
Throws: ObjectNotPersistenceCapableException
If the object is not persistence-capable.
Throws: ObjectStoreException
If PSE/PSE Pro is not initialized for the current thread or if the object is not associated with this thread.
Throws: SegmentNotFoundException
If the segment is not found.
Throws: IllegalArgumentException
If either the object or segment arguments are null.
Throws: UpdateReadOnlyException
If there is a read-only transaction in progress or if the database is open read-only.
 o useFileNatives
  public static void useFileNatives(int value)
Note: useFileNatives() is deprecated. The PSE Pro File Natives have been eliminated from PSE Pro 1.1.

 o isPersistent
  public static boolean isPersistent(Object object)
Determines whether the argument is persistent.

Parameters:
object - The object to check.

Returns:
The true constant if the argument is persistent. The false constant if it is not persistent.

Throws: ObjectException
is thrown if the argument is a stale version of a persistent object. Applications should discard references to persistent objects at the end of a transaction.
 o evict
  public static void evict(Object object)
Evicts a persistent object. If the dirty() method was previously called on the object and a transaction is in progress, ObjectStore saves the changes in the database when the transaction is committed. Whether or not the object was modified, ObjectStore clears the contents of the object and it becomes a hollow persistent object. An application must call the fetch() or dirty() method on this object to access its contents again. The application is responsible for ensuring that no other thread is relying on the contents of the object's being accessible at the time of the call. If an application calls evict() on a transient or null object, ObjectStore ignores the call and the application continues.

Equivalent to evict(object, RETAIN_HOLLOW).

Parameters:
object - The object being evicted. It must be persistent.

Throws: ObjectNotFoundException
If the object was destroyed, or its segment was destroyed.
 o evict
  public static void evict(Object object,
                           int retain)
Evicts a persistent object. What gets evicted is controlled by the value of the retain argument:

In all cases, the application is responsible for ensuring that no other thread is relying on the contents of the object being accessible at the time of the call. If an application calls evict() on a transient or null object, ObjectStore ignores the call and the application continues.

Parameters:
object - The object being evicted. It must be persistent.

retain - The state of the object following eviction. One of RETAIN_READONLY, RETAIN_HOLLOW, or RETAIN_STALE.

Throws: ObjectNotFoundException
If the object was destroyed, or its segment was destroyed.
 o evictAll
  public static void evictAll(int retain)
Evicts all persistent objects by running the evict(Object, int) method on all persistent objects known to the session.

See Also:
evict
 o evictAndForget
  public static void evictAndForget(Object object)
Note: evictAndForget() is deprecated.

The method evictAndForget() is a temporary device to deal with a limitation in version 1.0.2 of the JDK. It is expected that this limitation will be fixed in an upcoming release of the JDK. When it is fixed this method will be obsolete and will be phased out of the API.

It may still be useful to use this method on platforms which do not implement "weak references". The JDK 1.1 implements such references making use of this method unnecessary.

The evictAndForget() method first evicts an object as described in ObjectStore.evict(), and then removes the internally maintained association between this object and its persistent representation. Before invoking this method, the application must ensure that any persistent objects that contained references to this object have been evicted. After this method is invoked, the object cannot be used for any purpose. That is, its contents should not be accessed, nor should it be used for identity comparisons.

Use this method with extreme caution, and only if you find that your application is consuming excessive amounts of heap space within a transaction.

Parameters:
object - The object being evicted. It must be persistent. PSE/PSE Pro ignores transient and null arguments.

See Also:
evict
 o isStale
  public final static boolean isStale(Object object)
Determines whether the argument is stale. This function only returns meaningful results for objects which inherit from COM.odi.Persistent.

Returns:
true if the Persistent object is Stale or Destroyed; false if it's not stale or destroyed or if it's a transient instance of a Persistent object.
 o isDestroyed
  public final static boolean isDestroyed(Object object)
Determines whether the argument is destroyed. This function only returns meaningful results for objects which inherit from COM.odi.Persistent.

Returns:
true if the Persistent object is destroyed; false if it's not destroyed or if it's a transient instance of a Persistent object.

Copyright © 1996, 1997 Object Design, Inc. All rights reserved.