The only possible hangup with this is that the work is done, typically, in a transaction, and if the proxy is de-referenced outside of that transaction there is the possibility of stale data. On the other hand, the the same thing holds true using hibernate with an open session and closed transaction, and if the data wasn't loaded into the proxy during the transaction, it certainly wasn't used as part of it =)
-Brian
On Dec 20, 2004, at 10:33 AM, Ray wrote:
Thanks to everyone who replied.
It seems I was thinking that it used the Hibernate approach, which requires exposing the session right up to the presentation layer. I imagine that OJB does the same thing ... only the developer doesn't have to worry about it.
Seems I have a bit more reading to do before I make a start on the conversion, but at least it means we can keep much of the database objects the same as they are for Hibernte; we just have to change stuff below the service layer that returns these objects from the database.
Great stuff! Can't wait to get started!
Any good books on OJB, by the way? --- Brian McCallister <[EMAIL PROTECTED]> wrote:
---------------------------------------------------------------------I'll second this one -- the best approach I know is just to use the domain model object as the thing the JSP renders.
-Brian
On Dec 20, 2004, at 7:36 AM, Edson Carlos Ericksson Richter wrote:
I've used the OJB objects and collectionsdirectly, since they *are*session", even if youmy VO. There is no need to maintain any kind of "openare using proxies (OJB will care about opening adatabase session toload object on demand)... I never used OJB + EJB,so I can' tell youproblems.how this could work in a distributed environment. But with JSP accessing local datasources, I had nolead into unecessary
Copying object to other objects/collections couldrenderoverhead.
I expect this helps.
Edson Richter
Ray escreveu:
Hi there ... :-)
I'm involved in a small project to convert from a Hibernate backend, to OJB. The presentation tier uses Struts and JSTL tothepages.
I was wondering how you OJB handles collections attached to objects, that need to be rendered inthatJSP pages. For example, if I have an Order objecttocontains a collection of OrderLines, and I wantwhat iscreate a page to display the whole order, thenintothe bst way to handle this?
Is it best to copy the whole Order and OrderLinesOr dosome kind of VO, and then send that to the page?sessionyou use the Hibernate approach of leaving theJSTL onopen for the whole request cycle, so that thethethe page, can access the collection directly from__________________________________________________Order object?
Hope that makes sense ... :-)
protection aroundDo You Yahoo!? Tired of spam? Yahoo! Mail has the best spamhttp://mail.yahoo.com
---------------------------------------------------------------------[EMAIL PROTECTED]To unsubscribe, e-mail:[EMAIL PROTECTED]For additional commands, e-mail:
-- Edson Carlos Ericksson Richter MGR Inform�tica Ltda. Fones: 3347-0446 / 9259-2993
---------------------------------------------------------------------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]
__________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.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]
