Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

POF Nested Objects - using registerIdentity

894896Apr 25 2012 — edited May 1 2012
Was wondering if anyone has used this? Using the customer example in the 3.7.1 developer guide, the Product class has a nested object called Customer. I might have several Products with the same Customer. So I would want each Product to reference the same Customer object. But not sure if this would work with register identity.

it's also stated that there is some overhead with Coherence keeping track of these POF objects, does anyone know how much overhead?

++(from developer guide)++
++public void serialize(PofWriter pofWriter, Object o) throws IOException++
++{++
++Customer customer = (Customer) o;++
++pofWriter.writeString(0, customer.getName());++
++pofWriter.writeObject(1, customer.getProduct());++
++pofWriter.writeRemainder(null);++
++}++
++@Override++
++public Object deserialize(PofReader pofReader) throws IOException++
++{++
++String sName = pofReader.readString(0);++
++Customer customer = new Customer(sName);++
++pofReader.registerIdentity(customer);++
++customer.setProduct((Product) pofReader.readObject(1));++
++pofReader.readRemainder();++
++return customer;++
++}++
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 29 2012
Added on Apr 25 2012
5 comments
236 views