![]() |
Backend: OrbTrader Persistence over an Object Database |
Persistence
for the OrbTrader system was initially implemented using Object Design
Inc’s Object Store PSE.Persistent Storage Engine. A single-user persistence
storage engine is available for download from www.odi.com. Until now, Java
programmers were faced with a dilemma
when choosing how and where to store application data. Store-everything methods
such as Java’s object serialization are easy to use but are very slow,
and they provide very little reliability. Relational databases provide
integrity and reliability but they are expensive to use and administer,
are too large to be distributed through the web with Java applets, and
are optimized for queries on tabular data, not high-performance object
storage and retrieval.
Object Design solves the Java object storage dilemma with ObjectStore PSE Pro for Java -- the first native Java persistent object storage engine. ObjectStore PSE Pro for Java is a single-user persistent data store with a small footprint that provides transaction-oriented object storage for Java. It provides an easy to use
programming interface for storing and retrieving your Java objects from
multiple databases. The PSE Pro API is compatible with the multi-user ObjectStore
ODBMS API so you can easily scale your Java applications between single-user
desktop and high
Before compiling the java application that uses PSE, PSE comes with a java package that can be imported to the class that would need persistence. The path for the package needs to be added in CLASSPATH path for the java compiler to use it. To persist an object, Object Store’s post-processer (osjcfp) will have to be run with the class. This will make the class work persistently. Running the post processor, will result in an annotated class definition for the persistable class. The program can then be compiled and run. The Object database (*.odb)
will reside in the same directory of the main class file.
During the final stages of the project we ran into a problem persisting the Corba classes, specifically the Holder classes. Due to the time constraint, the group decided to use the JDBC which was easily implemented. JDBC is Java’s native API to send SQL statements to RDBMS systems. For the purpose of the demo,
an Access database was used to store trading information for OrbTrade.
The customer information was stored in a table containing username, accounts
and password. For the trading database another table was used to store
the information for trade orders.
|