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.  [ 4 posts ] 
Author Message
 Post subject: TransactionProxyFactoryBean
PostPosted: Mon Mar 02, 2009 10:11 am 
Beginner
Beginner

Joined: Wed Jan 28, 2009 10:16 am
Posts: 37
Hello,

I have to use the mecanism of session in my "facade" design pattern, but I do not realy understand how to do.

I use the Facade, Service, DAO system.
Do you know where find a easy sample about this.
Maybe the class in the title can be used ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 02, 2009 10:42 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Could you explain what you want to do? What mechanism do you mean? Can you post an example?

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 02, 2009 11:05 am 
Beginner
Beginner

Joined: Wed Jan 28, 2009 10:16 am
Posts: 37
In fact, I have to do some action like :
- Get object from the data base
- Save object in the data base


Currently in my DAO implementation object I have this method :
Code:
public boolean update(Object dossier) {
      Session session = HibernateUtil.getSession();
      Transaction transaction = session.beginTransaction();
      session.saveOrUpdate(dossier);
      transaction.commit();
      session.close();
      return true;
   }


But it was said to me that I need to manage the transaction in highter level.
Because a save of one object can need to save others object in the future and I need to be sure that my transaction is arround all the operation to do...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 02, 2009 1:05 pm 
Newbie

Joined: Thu Nov 20, 2008 10:24 am
Posts: 2
So, you're using Spring.

Take a look at the following free for download book which describes declarative transaction boundaries with Spring.

http://www.infoq.com/minibooks/JTDS

Also, take a look at the Spring reference on transactions:

http://static.springframework.org/sprin ... ction.html

See also:

http://forum.springframework.org/showthread.php?t=37178

For different Spring based transaction approaches.[/code]


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