Frequently Asked Questions about Ozone


Developing with Ozone

Q: I seem to be able to create db objects within other db objects with calls to new, rather than to createObject() but their behaviour seems erratic. Is this supposed to work or is it inadvisable?
Q: Can you explain about named objects, e.g. do names have to be unique within DB or only unique within a class of objects?
Q: Do all persistent classes need a constructor with no parameter and no body?
Q: Do all persistent objects need to be created by calling the no-parameter, no-body constructor? or can you call another constructor?
Q: What is the difference between creating objects from outside the db server and creating them from within the db server?
Q: It's written in the documentation that the whole object is saved and method invocations are sent to the objects in the database. Is this always the case (that the method invocation is taking place in the db)?
Q: Is serialization used?
Q: Am I right in thinking that if you create an object with database().createObject(), the constructor of myObject can't create other objects - I get an "object is not yet associated to a database container" exception.
Q: Is there an equivalent callback for object deletion
Q: If I have a database object which has an attribute that has a list of ordinary serializable objects, does the list gets loaded when I access one of these Objects?
Q: That would be a problem as the list could be quite large and loading it would require lots of RAM. How do you suggest I design this in order to minimize redundancy and memory consumption?
Q: What about Schema evolution?
Q: How would I go about retrieving the object with the oldest creationDate attribute? Also, is it possible to retrieve an object or a set of objects based on the exact attribute value (e.g. all cars made in 1974)? Similarly, is it possible to retrieve an object or a set of objects bases on the range of values (e.g. all cars made between 1974 and 1984)?
Q: Say we have the query "Select name from table where name=manav". How can i do the equivalentthings in Ozone? I.e. how can I perform QUERY Like things in OZONE such as Select,Delete,Update etc.

A:adding/removing method and adding of members works. See jdk doc about serialization and serialVersionUID.

If you make your database objects 'Externalizable' and implement read/writeExternal clever you can do a pretty good schema evolution. You can then use a version number (not serialVersionUID !), write it in writeExternal, check it within readExternal and do additional actions if the version number has a particular value. Thus you can avoid the normal serialization schema evolution limitations, e.g. removing a member. The serialVersionUID stays always the same. Because of this Java thinks the streamed objects are always compatible to the current implementation. The second version number is for you to control which version you've got serialized.

Performance

Q: Are there any benchmarks on Ozone?
Q: How does it perform as the amount of data increases?
Q: Can you point me to any documentation that might describe how best to adjust the cluster size, table size, etc. for best performance?
Q: Does the DB server use connection pooling?

A:cluster size does not affect performance that much. But the size of the object cache (JVM heap size) and the dimension of the B-tree caches are very important. The Admin documentation or Server Configuration should help you to get started with this. You should always try to adjust cache and table sizes so that the _working set_ of your data is kept 'in cache'. That is, all objects of your working set of data should fit in memory and the B-tree tableBufferSize should be <= the number of objects in your working set.