RegisterSign In

API Documentation: Class ODBSession

Package: com.mckoi.odb

The client interface for interacting with an Object Database path instance. The object provides a stable session state in which transactions can be started and interaction with the data model can be performed. ODBSession objects are intended to be long lived.

Constructors Summary

ODBSession(MckoiDDBClient client, String path_name)

Methods Summary

String getPathName()
ODBTransaction createTransaction(ODBRootAddress root_address)
ODBTransaction createTransaction()
ODBRootAddress getCurrentSnapshot()
ODBRootAddress[] getHistoricalSnapshots(long time_start, long time_end)
boolean equals(Object ob)

Constructor Details

ODBSession(MckoiDDBClient client, String path_name)

Constructs the ODBSession with the MckoiDDBClient object (needed to talk with the network) and the path instance name of the database on the network.

Method Details

String getPathName()

Returns the name of the path instance of this session.

ODBTransaction createTransaction(ODBRootAddress root_address)

Returns an ODBTransaction object based on the data in the given root address. This method is useful for reducing the amount of traffic on the network needed to check if an instance path has changed. Many applications do not always need to fetch the most current snapshot when reading data because it doesn't matter if the information is slightly out of date.

This method allows a client to decide for itself when it wants to check if the state of a database has been updated, and allows reusing the old snapshot views when it is appropriate to do so.

ODBTransaction createTransaction()

Creates a current snapshot transaction object used for accessing and modifying this Object Database path instance. This method will query the network and fetch the latest version of the path instance from the root server.

This is the same as calling 'createTransaction(getCurrentSnapshot())'.

ODBRootAddress getCurrentSnapshot()

Returns an ODBRootAddress that represents the most current snapshot of this path instance. This method will query the network and fetch the latest version from the root server.

ODBRootAddress[] getHistoricalSnapshots(long time_start, long time_end)

Returns an historical set of root node addresses committed to this path between the times given, where the time values follow the conventions of System.currentTimeMillis().

Note that the returned root nodes may not be completely accurate because the mechanism that records the time for each commit does not follow a strict requirement for accuracy. For example, if a root server managing commits for a path instance fails over to a new host, the clock on the new host may be out of sync with the previous host thus it may appear that some commits have happened at the same time and not in a serial sequence.

Therefore consider the nodes returned by this method to be a reasonable approximation of all the snapshot states committed in the given time span.

boolean equals(Object ob)

Returns true if the sessions compare equally.

The text on this page is licensed under the Creative Commons Attribution 3.0 License. Java is a registered trademark of Oracle and/or its affiliates.
Mckoi is Copyright © 2000 - 2020 Diehl and Associates, Inc. All rights reserved.