Answers inline: Thanks Jeff. 1. This is all happening in remote Service (I dont have access to assembler's transaction there). Hence I am creating new DataServiceTransaction. Does refresh and update happen on a different thread? For assemblers, I use Hibernate Interceptor which works great.
When you call "dst.commit()" the entire refresh of the fills happens inside of that call. All pushed messages are also put into the client queues synchronously as part of that call. 2. singleSession = true binds a session to a threadLocal, so the same session should be available to all as long as its happening on the same thread Interesting... so it seems like the problems you were seeing are still not explained? 3. If we have one-many relation(parent child) in assembler, which points to the same assembler. If a child changes outside of the scope of the assembler, do we need to send refresh on the child only or parent only or the recursively from top most parent to bottom most child. If the property values of the child items change, you only need to call updateItem on the child destination. If a child item is added or removed from an association that happens on the parent destination. When you use auto-sync, we keep track of the reference graph and so can route the changes to the appropriate clients just knowing the "leaf" change. We walk back up the reference graph to find all clients that are looking at that item. Jeff --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Jeff Vroom" <[EMAIL PROTECTED]> wrote: > > Hi Shailesh, > > > > I'm not sure what the problems are... It sounds like you are using the > DataServiceTransaction.begin() and commit() methods yourself (the other > way this can be used is if you call the > DataServiceTransaction.getCurrentDataServiceTransaction() call from > inside of an assembler method such as "createItem"). When you call > begin, if you specify useJTA="false" I think that when you call commit() > on the data service transaction that those calls should go out no matter > what. By the time this calls is made though, we will assume that the > changes you are telling us about have been applied to the data base and > either have already been committed. It could be that you are calling > "commit()" just before the transaction has been committed? The part > that could go wrong there is the refresh fill process. If you call > "createItem()" and then commit(), the commit will go through each > managed fill and potentially re-execute those queries to pick up the > newly added item. If this fill call re-queries the database so it does > not see the change applied, it would not refresh it properly. > > > > It might be that in one mode you are using the HibernateAssembler picks > up the same session and so sees those changes and in the other mode is > picks up a different session? I'm not sure... if you still have > questions and can generate a server debug log for the problematic case > I'm happy to take a look. > > > > Jeff > > > > ________________________________ > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of Shailesh Mangal > Sent: Wednesday, February 13, 2008 2:57 PM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Flex Data Management and container's > UserTransaction > > > > Turned out that Its not the transaction, its OpenSessionInViewFilter's > flag for singleSession which caused my updates fail [For reasons not > known]. > So, in a nut shell, If you have, > 1. singleSession = true, DataServiceTransaction wouldnt send out the > updates > 2. singleSession = false, DataServiceTransaction send out the updates > just fine. (problem with this approach is bulk operations will exhaust > resources as every request will fetch a new session object) > > Will appreciate comments if any one has witnessed the same behavior. > > -Shailesh > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > , "Shailesh Mangal" > <shailesh.mangal@> wrote: > > > > In usecase-2, what should happen when method that begins > > dataServiceTransaction is already within a JTA transaction. > > > > In our codebase, We have some remote services which send refreshes to > > the client using DataServiceTransaction. All these refreshes were > > working fine until we wrapped my services into Spring > > TransactionProxy. Any clue is highly appreciated. We tried it with > > both useJTA=true and useJTA=false > > > > One other side query: > > If we have one-many relation(parent child) in assembler, which points > > to the same assembler. If a child change, do we need to send refresh > > on the child only or parent only or the recursively from top most > > parent to bottom most child. > > > > -Shailesh > > > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> , "Jeff Vroom" <jvroom@> wrote: > > > > > > There are two use cases where we DMS will use the UserTransaction. > > > > > > > > > > > > 1) When your assembler has "use-transactions=true", and you > commit > > > a change or batch of changes, the DMS code will start a transaction > > > before calling your createItem, updateItem, and deleteItem > methods. If > > > any of those get an error, the transaction is rolled back and all > of the > > > changes are put back into the uncommitted list on the client. If > they > > > all succeed the transaction is committed and the changes pushed to > other > > > interested clients. > > > > > > > > > > > > 2) If you use the DataServiceTransaction api to push changes > from > > > the server, when you call begin you can pass in a value of "true" > which > > > causes the DMS stuff to start a JTA transaction in that call. > When you > > > call commit, the JTA transaction is committed if the setRollbackOnly > > > call was not made. This is just a convenience if you happen to have > > > some JDBC code which is updating the database. You want to both > commit > > > those changes and push the changes to other clients or rollback > those > > > changes and cancel those changes. > > > > > > > > > > > > For 1), when you are also using Hibernate, the hibernate assembler > will > > > register a hibernate current session context class. The goal of this > > > class is to ensure that we create one hibernate session for each JTA > > > transaction we create for DMS and commit/roll them back in sync. > Going > > > forward I'd like to offer another way to do this so that we can more > > > flexibly integrate with other ways of using hibernate sessions. > > > > > > > > > > > > Jeff > > > > > > > > > > > > ________________________________ > > > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> > [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > ] On > > > Behalf Of den.orlov > > > Sent: Wednesday, December 12, 2007 2:10 AM > > > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > > > Subject: [flexcoders] Flex Data Management and container's > > > UserTransaction > > > > > > > > > > > > As I understand Flex Data Management Services require that > application > > > container provide UserTransaction for it. But I can't find any guide > > > about how FDMS uses it. > > > > > > I was completely confused when I checked several tutorials that used > > > FDMS+HibernateAssempler+Spring or FDMS+hand written > > > Assempler+Hibernate+Spring. > > > > > > That tutorial > > > > http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html <http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html> > <http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html <http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html> > > > > > > <http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html <http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html> > <http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html <http://blogs.adobe.com/mtg/2006/08/my_first_hibernate_enabled_fle.html> > > > > > > > > > specify that Hibernate's SessionFactory use datasource not tied to > > > global transaction manager. > > > > > > This tutorials: > > > > http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring- <http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring -> > <http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring <http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring > > -> > > > and-hibernate/ > > > > <http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring <http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring > > <http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring <http://devblog.ezmo.com/2007/05/29/using-flex-data-services-with-spring > > > > > > -and-hibernate/> > > > > http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servic <http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servi c> > <http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servi <http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servi > > c> > > > e-application/ > > > > <http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servi <http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servi > > <http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servi <http://iamjosh.wordpress.com/2007/11/08/building-a-livecycle-data-servi > > > > > > ce-application/> > > > don't specify that SessionFactory should use global transaction > scope > > > for Session and use local transaction management. > > > > > > So what's the purpose of FDMS to have reference to container's > > > UserTransaction? > > > > > > Den > > > > > >