Topic: struts 框架使用,出现的事务控制问题,请高手做答

  Print this page

1.struts 框架使用,出现的事务控制问题,请高手做答 Copy to clipboard
Posted by: xidaboy
Posted on: 2004-10-18 09:18

目前系统中对事务的控制放在了上层,即ACTION的初始化到调用结束,即一个ACTION一个事务,配合到页面上就是一个页面,一个请求,一个ACTION,一个事务,目前存在问题,当进行财务转帐时,其间经历三个画面,1,输入信息转出.2输入信息转入检查3.确认后转入,分别对应3个ACTION请求,我想将整个过程放到一个事务中,但是又不要破坏现有框架,望高手做答,拜谢!

2.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: xidaboy] Copy to clipboard
Posted by: floater
Posted on: 2004-10-18 11:04

options:
1. save the first two action states in the session, and do the transaction in the 3rd action. Just becareful that a File|New browser shares the same session as the original one.
2. save the first two action states in a database table and do the transaction in the 3rd action. It's safer than the first one but requires database storage.

3.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: xidaboy] Copy to clipboard
Posted by: xidaboy
Posted on: 2004-10-19 09:38

floater
谢谢你的回答,但是没有解决问题啊,问题第1步操作后,给记录加上的是只读锁,这很重要,是不可能使用SESSION和中间表的,希望高手继续解答

4.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: xidaboy] Copy to clipboard
Posted by: floater
Posted on: 2004-10-19 22:41

问题第1步操作后,给记录加上的是只读锁 - that's why I said you save your data to somewhere else, not your target table. You work on the target tables only in the 3rd action.

5.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: xidaboy] Copy to clipboard
Posted by: xidaboy
Posted on: 2004-10-21 08:59

还是有问题啊,因为这是个财务转帐的过程,我将数据存在别的地方是不合适的,第1个锁是一定要靠事务加上的,请帮忙解答,拜托用中文的拉

6.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: xidaboy] Copy to clipboard
Posted by: wes109
Posted on: 2004-10-21 10:48

xidaboy wrote:
目前系统中对事务的控制放在了上层,即ACTION的初始化到调用结束,即一个ACTION一个事务,配合到页面上就是一个页面,一个请求,一个ACTION,一个事务,


是怎么做的?
用filter还是作了一个BaseAction

7.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: wes109] Copy to clipboard
Posted by: xidaboy
Posted on: 2004-10-22 13:08

wes109 wrote:
是怎么做的?
用filter还是作了一个BaseAction

struts框架提供的类有初始action类的方法,再该方法外

8.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: xidaboy] Copy to clipboard
Posted by: xidaboy
Posted on: 2004-10-26 11:05

服了,这样的问题也没人讨论,哎,我想到解决方案,简单的让同一actionform对应三个页面就可以了,晕死,这真......................................

9.Re:struts 框架使用,出现的事务控制问题,请高手做答 [Re: xidaboy] Copy to clipboard
Posted by: floater
Posted on: 2004-10-26 11:52

that's my #1, and I don't think that's safe for this kind of applications due to the reason I mentioned.

my #2 is ok if you just save it temperorily(save and delete).


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923