Wanted to ask a 'design' question
I have 3 tables
A,
B
and AB
where AB is a join table on ids from A and B
A and B have grids for them , and I use Restful Perserver store
on each.
(I do not have a restful store for AB, but can make any store
-- since it is not attached to a widget)
I want the user to be able to delete (if they so desire)
A or B or both
or 'dissasociate' A from B (meaning keep A and B entries but delete
the AB relation).
I am having a little bit of difficulty conceptualizing transaction
control
and 'store' updates.
In a typical situation, I would have a PHP method to
do deal with all the deletes in proper order within one
php invocation (to preserve transaction control).
So I would do:
func removeB
{
begin transaction
delete AB relation
delete B
commit
}
Now that I have restful stores associated with A and B,
I cannot do that -- because I have to initiate a delete
from a store, but if I say
do in my dojo page
AB_store.delete
B_rest_store.delete
that would issue two separate calls and those can go to two
separate database connections -- so I cannot do transaction
control.
I saw a brief reference in one of the docs about this
"..
JsonRestStore provides transaction state information so that servers can
implement transactions that correspond to the Dojo Data it saves if
desired (this is not necessary for a server to implement in order to
support REST). Transactions are indicated by a X-Transaction header in
the modifications requests. If the X-Transaction header has a value of
open, this means that further requests will be delivered that should be
included in the current transaction.
..."
but I am not seeing how this can help me to make a 'single' call
or may be there is a way to just issue a call manual to do the
deletes and then somehow update the restful stores -- without
having them issuing any commands to the server again?
thank you,
Vlad
--
Vlad P
author of C++ ORM
http://github.com/vladp/CppOrm/tree/master--
http://www.fastmail.fm - A no graphics, no pop-ups email service
_______________________________________________
FAQ:
http://dojotoolkit.org/support/faqBook:
http://dojotoolkit.org/docs/bookForums:
http://dojotoolkit.org/forumDojo-interest@...
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest