-->
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: THINK : Hibernate in Service oriented architecture
PostPosted: Thu May 12, 2005 4:12 am 
Beginner
Beginner

Joined: Mon Jun 07, 2004 4:31 pm
Posts: 45
Location: France
Hibernate version: 2.1.8

Hi all,
I've got a conceptual question about hibernate.
I've got a service which have two functions

public Entity service.get(Entity)
public Entity service.update(Entity)

I've got to implement a business rule apply on a property of Entity
object in update function.

The problem is :

The two methods are call in the same transaction which is propaged by Spring so if a user change values of Entity between calls of get and update
functions, I did not have the old values of Entity.

I can put a function getOldEntityValues(id) in DAO layer using HQL
I can set an interceptor on preFlush or flushDirty

I don't like this two methods, is there a best way ??


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.