Yupp dump it into sourceforge, two days ago I opened a backend dir
with one datamodel already in place (that one uses page prefetching
instead of servlet/page filter callbacks)
Might be a good place for the others to dump their solutions.
Because the data model, demarakation point, how to bind hibernate
question pretty much comes up every month.
Werner
Enrique Medina wrote:
Lorenzo,
I will try a similar attempt ...
anyway, many thanks for the answer now I have a way ;)
Would you mind sharing with us your final solution to the problem?
Thanks.
2005/6/29, Lorenzo Sicilia <[EMAIL PROTECTED]>:
steve rock wrote:
There are 2 ways to solve this.
1. specify eager fetching in your HQL. Return all the fields you need
in the first request. Once the object becomes detached from the db in
the second request, it will not execute any sql to fetch any
non-loaded fields due to lazy loading.
mmmm... if a change occured in my db I can get some problems.
2. If you still want to use the lazy loading features and not do an
eager fetch in the first request, reattach your detached persistant
bean to the database in the second request. This simply means in you
code call
session.lock( yourPersistantBean, LockMode.NONE) (there are other lock
modes). Then you can access the fields that are lazy loaded and not
throw the exception..
I will try a similar attempt ...
anyway, many thanks for the answer now I have a way ;)
regards Lorenzo