-->
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.  [ 1 post ] 
Author Message
 Post subject: Persistence of LDAP entries via Interceptor
PostPosted: Fri Dec 05, 2008 1:39 pm 
Newbie

Joined: Tue Sep 23, 2008 5:59 am
Posts: 3
Hibernate version: 3.2.6.ga

Hi,

I have a User object that contains some attributes that are persistent to my Oracle DB and some that are persistent to my LDAP server. I've created a LdapInterceptor class (sublcass of EmptyInterceptor) and overridden the onFlushDirty() method so persist the LDAP attributes.

This works fine as long as you change one of the Oracle persisted attributes, from which Hibernate can tell that the entity is dirty. However the LDAP attributes are marked as @Transient and so if you only change one of those attributes Hibernate does not know that the entity is dirty and onFlushDirty() does not get called.

How can I ensure onFlushDirty() is called if only the LDAP attributes are changed?

As an aside, the neat thing about the Interceptor mechanism is that (in theory) there is only one representation of a User in the system and Hibernate (again in theory) maintains the two data stores via the Interceptor. Do people think this way of doing it is a good idea and has anyone got a better idea?

Thanks & Regards

Ted


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

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.