In an environment where Hiberante is integrated with J2EE AS. Session beans SA and SB. Client calls SA, which then calls SB several times to do a complex business logic. SB will retrieve a relatively large graph of objects and return it to SA, which makes changes to that graph of objects. Then SA passes the modified object graph to SB to be persistent. After reading hiberante manual and "in action" book, I decided to use session-per-request and detached objects pattern. I also use CMT, in which SB joins a flat JTA transaction initiated by SA, so if any one of the calls from SA to SB fails, the whole transaction aborts.
My question is how to efficiently return a graph of objects (around 10 or more, which references each other) from session bean SB back to SA? And also how to pass the modified object graph from SA to SB? Using DTO? Or just pass the root node of the graph and the serialize() will recursively serialize the whole graph of objects?
Thanks,
Stan
|