> > if you don't mind hitting the database on every request. > > If you use Hibernate caching, you're not hitting the DB. I like this > approach best: it keeps data fresh, and you can let you Hibernate > cache plugin deal with data consistency issues instead of your app. >
> Add to that a custom SqueezeAdaptor that fetches your Hibernate > objects, and you can basically act as though you're just passing > persistent objects to and from listeners, even though they're > magically always a new, up-to-date object on each request. I did just that but i run into trouble with unwanted updates in case of submiting changes: 1) Custom SqueezeAdaptor fetches object 2) Tapestry updates values of my persistent object (object is now dirty for Hibernate) 3) Now if i make some call to other related objects Hibernate may call insert or update If i now deside, that there was something wrong with data submited, i would rollback. But problem is that other sessions from other users are seeing my rollbacked changes. I use Ehcache with most objects configured 'read-write' cache option. i see in my startup logs following lines 16:52:55,538 INFO transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions) 16:52:55,538 INFO transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) How can i hide changes inside transaction from other sesions? At the moment i use approach that i check if everithing is ok and only then attach object to sesson bt session.lock and save changes. Rick
