ow wrote:
Hi,
A few questions about OJB:
1. Suppose a proxy is used to represent a whole collection. Does a "session/transaction" have to be opened prior to accessing this collection for the first time?
open transaction is not required.
2. I believe OptimisticLockException will be thrown with ODMG API if the record was deleted/modified. Can optimistic locking be used with PB API?
yes!
How is the optimistic locking implemented, is it a check for the number of updated records?
it's implemented as an additional predicate in the where clause: instead of UPDATE table SET column = Expression WHERE id = 23
the following statement is executed:
UPDATE table SET column = Expression
WHERE id = 23
AND VERSION = 3Using this additional predicate we avoid udpdates in case the version has changed.
OJB supports INT and Timestamp columns as optimistic locking fields.
Usage is explained in the FAQ.
3. Does OJB support dependent objects?Yes,
E.g. Person object has properties streetAddress, city, state, zipCode. Can streetAddress, city, state, zipCode properties be mapped to the dependent object Address that is contained by Person?
You have to tell OJB to use a PersistenField implementation supporting this in OJB.properties first, as it is not yet implemented in the default implementation:
PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentNestedFieldMaxPerformanceImpl
if your class has an attribute "address" of type Adress,
the mapping for the "streetAddress" attribute of "address" would look like follows:
<field-descriptor id="10"
name="adress->streetAddress"
column="ADR_STREET"
jdbc-type="VARCHAR"
/>Yes, there is a liitle section in the FAQ on this topc. Query.html also contains some more details
4. OJB supports mapping of direct SQL to a class, doesn’t it?
cheers, Thomas
Thanks in advance
__________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
