-->
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: Serializable Transaction
PostPosted: Fri Feb 19, 2010 10:29 am 
Newbie

Joined: Thu Nov 12, 2009 5:43 am
Posts: 3
Spring 2.5.6 / Hibernate 3.3.2 / Oracle 10g / hibernate.transaction.factory_class not specified (default value) / HibernateTransactionManager

Code:
@Service("bookService")
@Transactional(propagation = Propagation.REQUIRED)
public class BookServiceImpl implements IBookService {

    @Autowired
    private IBookDao bookDao; // uses @Autowired SessionFactory

    @Transactional(readOnly=true, isolation=Isolation.SERIALIZABLE)
    public List<Book> getAllBooks() {
        Thread.sleep(20000L); // simulates business code*
        return bookDao.getAll();
    }

}


If somebody updates several books before bookDao.getAll() is invoked*, then bookDao should return "old book values", instead of returning the new ones. With pure JDBC it works perfectly. But with spring managed transaction it does not work at all. What is the problem ? Do I need to configure something special ?
Spring seems to set correctly the transaction isolation level (I can see it in dao tier). So it the problem seems to come from Hibernate.


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.