I'm not currently using Flex, but I don't believe it's possible to map
ActionScript classes to lazily-loaded Hibernate classes because of all the
hibernate proxy stuff. I was under the impression that you have to use DTOs,
rather than mapping your client classes to your domain objects. Am I wrong?

- Richard

On 11/28/06, Douglas McCarroll <[EMAIL PROTECTED]>
wrote:

  Hi All,

This is essentially a repost of my "How to implement Lazy Hibernate?"
question.

I'm still completely stuck. Here's the error message I'm getting:

[RPC Fault faultString="Page request made for item with id =
'{filmId=null}'. The item was not in the cache and the adapter's get
method failed to return the item for destination = film.hibernate that
is expected to be in the requested page." faultCode="Server.Processing"
faultDetail="null"]

Here's the big picture:

I'm attempting to create a Cairngorm/FDMS/Hibernate/MySQL example program.

I have three tables. 'actor' and 'film' have a many-to-many relationship
so they're connected by a link table 'film_actor'.

I've used HibernateTools to create .java and .hbm.xml classes by reverse
engineering the DB. I assume the HibernateTools knows what it is doing
so I'm assuming that the generated code is correct.

And I've successfully implemented .as classes and
data-management-config.xml and displayed data. I can click on an actor
and display the films that s/he's in. This all works through a single
destination that uses my Actor.java class. This uses the 'hierarchical
values' approach to managing hierarchical collections, i.e. just using
the 'actor' destination.

This approach is problematic because there are circular references
between Actor and Film objects. It seems to me that the obvious solution
is lazy loading. I don't see anything in the docs explaining how to do
this with the hierarchical values approach, so I'm attempting to use a
'lazy' managed associations approach. But I get the above error.

Someone who knows FDMS might be able to look at my code and fairly
easily point me in the right direction.

I've zipped up the entire project - plus a .sql file you can use to
create my MySQL DB - and put them up for download:


http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associations/Bw_005.zip

Or, you can just look at the code here:


http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associations/code.txt

The DB's schema is here:


http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associations/index.html

And here's a lovely variables view of the circular references I'm trying
to avoid :-) :


http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associations/deeply_nested_actors_and_films.jpg

Help?

Douglas

Reply via email to