I donot config transaction in hibernate.cfg.xml . When I execute the code,an exception is caught in POS2.But,I expect it to be caught in POS1.Do I miss something?
Thanks!
[ May 26, 2005: Message edited by: donald zhang ]
[ May 26, 2005: Message edited by: donald zhang ] [ May 29, 2005: Message edited by: donald zhang ]
I donot post the e.printStackTrace() because there is some Chinese character in it.It complaines that the value is too long to be saved. Any suggestion?
once this said, i notice a coincidence: your bean name equals your error message; coud you post just the (english) relevant parts of your error message?
The max length I assigned is a appropiate value.I cannot increase it.Besides,the user can always input a longer value.
I konw the following solution: 1),Modify the UI.If the user input longer data than I expect,prompt the user 2),Modify the DAO.When executing db execution,if the property is too long,throw an exception
I think the first one is better.
But I think there should be a better solution.Because all these solutions can only deal with expected error(user data too long).If something I donot expect happens,the user(even me) wonot know things went wrong.