On 12/19/05, Paul Cantrell <[EMAIL PROTECTED]> wrote: > > > 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. > > What? If that's true, either you're not actually rolling back, or > you're hanging on to persistent objects across requests. > > Hibernate's cache is transactional.
I use default isolation level, maybe thats the problem? Do you have some example code to paste whats deal with Tapestry and Hibernate transactions? Rick P > > > On Dec 19, 2005, at 9:14 AM, Rick Uks wrote: > > >>> 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 > > _________________________________________________________________ > Piano music podcast: http://inthehands.com > Other interesting stuff: http://innig.net > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
