-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Solving Lazyloading issue with non JAVA tiers?
PostPosted: Fri Feb 18, 2005 1:48 am 
Beginner
Beginner

Joined: Fri Mar 05, 2004 1:48 pm
Posts: 28
I've been looking at different mechanisms people are using to get around the lazy loading issues when using DAO patterns etc. My problem is that I am using Coldfusion as the presentation layer. I have generated a DTO using Hibernate Tools and I wrote a java DAO to perform CRUD for it. I can use the DAO from Coldfusion just fine, as well as the DTO but of course I need to deal with lazy loading for some relations/collections.
Mostly, I don't see how to translate any of the solutions like "Open Session in View" to something useable by another layer. Can this be done and if so does anyone have any insight.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 7:51 am 
Beginner
Beginner

Joined: Tue Jan 18, 2005 9:37 am
Posts: 29
Location: The Netherlands
Have you found a solution yet?
We are also looking for a solution. Maybe opening a session before the coldfusion cfm page is constructed (for example in application.cfm) and then close the session at the end. The DAO's should then use this session.

Another hibernate session should be used for coldfusion Session variables. This session will have to be opened when the user starts a http-session and closed when it times-out or disconnects.

Another solution can be: using Spring, like explained in :
http://www.hibernate.org/110.html

Any comments?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 8:12 am 
Beginner
Beginner

Joined: Fri Mar 05, 2004 1:48 pm
Posts: 28
Hi,
I tried the filter route but I always run into some class conflicts because of the fact CF is built on top of Jrun. Hibernate will load up and load a cfg.xml file and perform the mappings at startup but when I am requesting a session I get the class conflicts.

I know Spring can handle this but I am not exactly sure how to integrate Spring into this enviornment (Coldfusion either). I have tried different solutions for various issues such as this I have had and it usually turns into a dead end after losing a few days or weeks investigating or some really funky workaround I am not entirely happy with.

For now I have just decided to write the DAOs as CF Components which handle getting the session. This is highly repetative but we'll see how well the pattern works. I really need to break the session factory out in some sort of global var so hibernate is not loading all of the mappings everytime for each application. I'll post the pattern eventually to get some feeback on the robustness. I don't see any problem with it but maybe some of the experts will see a potential problem.

Thanks,
Troy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.