由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - How do I declare a transaction among 2 spring service calls
相关主题
Help: 2 threads transaction management issueWhat are the key features of the EJB technology?
Open Too Many Cursor Issue问个多线程问题
git & java求OpenShift上Spring-quickstart的mysql配置方法
多线程真头疼,但也挺有趣[转载] Re: java thread problem
我也来问问题了an Array question
Spring例子求解释请高手指教:Tomcat JNDI problem
自己管理session要每次手动释放么Servlet里面怎样简单设置数据库路径
spring 和 jsf 的整合How would clear a BufferedImage?
相关话题的讨论汇总
话题: xml话题: commit话题: step话题: do
进入Java版参与讨论
1 (共1页)
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.
1 (共1页)
进入Java版参与讨论
相关主题
How would clear a BufferedImage?我也来问问题了
Question on JSP ELSpring例子求解释
[合集] Web Service Java 客户端的问题自己管理session要每次手动释放么
[合集] How to check whether a file is locked?spring 和 jsf 的整合
Help: 2 threads transaction management issueWhat are the key features of the EJB technology?
Open Too Many Cursor Issue问个多线程问题
git & java求OpenShift上Spring-quickstart的mysql配置方法
多线程真头疼,但也挺有趣[转载] Re: java thread problem
相关话题的讨论汇总
话题: xml话题: commit话题: step话题: do