如何在多用户环境中处理表单编辑

如何在多用户环境中处理表单编辑

本文介绍了如何在多用户环境中处理表单编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是具有服务器和客户端的多用户应用程序.在这种形式中,多个用户可以同时访问,他们可以执行另存为草稿"或提交"操作.

My application is Multi-user application with server and client. In this one form is access by multiple user at the same time and they can perform save as draft or submit action.

问题是我想控制多用户同时编辑表单.

The issue is that I want to control simultaneous editing of form by multi user.

例如:用户X正在编辑文本字段,复选框的值,并执行另存为草稿.同时,用户Y编辑相同的值并提交表单.有什么方法可以控制同时进行的表单编辑.有指针吗?

For Example: User X is editing a value of textfield, checkbox and perform save as draft. And at the same time User Y edit the same value and submit form. Is there any way to control simultaneous form editing. any pointer?

我在应用程序中使用java,spring 3,休眠JPA.

I am using java , spring 3 , hibernate JPA in application.

推荐答案

您在寻找乐观并发控制.使用JPA/Hibernate,可以简单地添加实体中的@Version带注释的字段.

You're looking for optimistic concurrency control. With JPA/Hibernate, it can be as simple as adding an @Version annotated field in your entity.

这篇关于如何在多用户环境中处理表单编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:16