What are the differences between the PersistenceBroker API and the ODMG API? Which one should I use in my applications?
The PersistenceBroker (PB) provides a minimal API for transparent persistence: • O/R mapping • Retrieval of objects with a simple query interface from RDBMS • storing (insert, update) of objects to RDBMS • deleting of objects from RDBMS This is all you need for simple applications as in tutorial1. The OJB ODMG implementation uses the PB as its persistence kernel. But it provides much more functionality to the application developer. ODMG is a full fledged API for Object Persistence, including: • OQL Query interface • real Object Transactions • A Locking Mechanism for management of concurrent threads (apps) accessing the same objects • predefined persistent capable Collections and Hashtables Some examples explaining the implications of these functional differences: • Say you use the PB to query an object O that has a collection attribute col with five elements a,b,c,d,e. Next you delete Objects d and e from col and store O again with PersistenceBroker.store(O); PB will store the remainin