-->
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.  [ 2 posts ] 
Author Message
 Post subject: Proxying objects in a PersistantCollection
PostPosted: Wed Sep 28, 2005 4:56 pm 
Beginner
Beginner

Joined: Wed Jul 13, 2005 2:18 pm
Posts: 44
I'm experimenting with using AOP techniques (ala Spring) to handle transaction demarcation declaratively. As part of my experimentation, I thought it would be neat if I could have detatched business objects reassociate themselves with a currently existing session automatically when they're used.

I created a simple interceptor class which intercepts calls to my DAO objects and proxies any returned business objects. The proxy objects can then reassociate their target business objects with a currently existing session when appropriate. This works fine.

Once a business object is proxied, any associated business objects which it returns should also be proxied. Here's where I run into trouble. I need to be able to swap the objects in a PersistantCollection with proxied versions of themselves without setting the dirty flag on the collection. I can't find a way to do this.

Can anyone think of a not-too-complicated way to do what I'd like to do? The API says that PersistantCollection objects are treated as value objects, so *theoretically* could I instantiate a brand new one (provided I instantiate the correct subclass)? What pitfalls would that include?

_________________
- Matt


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 9:23 am 
Beginner
Beginner

Joined: Wed Jul 13, 2005 2:18 pm
Posts: 44
Sigh. So there's no way of proxying the objects in a PersistantCollection without the dirty flag being set? I'm about ready to give up and move on to other things, but I'm still holding onto a sliver of hope

_________________
- Matt


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.