g*****g 发帖数: 34805 | 1 I have an operation which is a 3 steps process. It looks like this.
1. Make some changes, commit to server, get an XML back.
2. Sign XML on client side
3. Commit the signed XML to server.
I do have all information before step 1 starts, but due to
security reason, step 2 has to be done on client side. Pass the
signature to server is not an option.
I want to make the whole process a transaction, in case step 3
fails, I want to rollback the changes in step 1.
Unfortunately, I can't do an undo for s | m******t 发帖数: 2416 | 2 If it's really commited in step 1, then what's done is done, I don't see how
you can roll it back (and you mentioned compensation wasn't an option
either.)
You might be able to achieve what you want to do by doing client-side
transactions, i.e., having the client demarcate a transaction around step 1,
2,3. But you'd have to do it programmatically, and obviously there are risks. | h*********o 发帖数: 62 | 3 Commits on the Spring level do not mean that you commit at the datasource
level. Spring transaction mangement really maps the specific datasource
transaction management you use, which in turn might map to another abstract
transaction layer. as long as you do not commit to the permanent storage,
you can roll back your transaction.
But if you commit ur transaction to the db layer, as magicfat said, what's
done is done. there is no turning back.
Hibernate has something called "application transacti | g*****g 发帖数: 34805 | 4 I get an idea, I would do step 1 without commiting on server, only
get the XML back, then commit the changes of 1 and 3 together.
【在 g*****g 的大作中提到】 : I have an operation which is a 3 steps process. It looks like this. : 1. Make some changes, commit to server, get an XML back. : 2. Sign XML on client side : 3. Commit the signed XML to server. : I do have all information before step 1 starts, but due to : security reason, step 2 has to be done on client side. Pass the : signature to server is not an option. : I want to make the whole process a transaction, in case step 3 : fails, I want to rollback the changes in step 1. : Unfortunately, I can't do an undo for s
| t*******e 发帖数: 684 | 5 你不要explicitly call commit method. 用个大method encapsulate 3 个operations
, 然后再这大method上declare transaction attributes. |
|