简单的EJB问题# Java - 爪哇娇娃
c*k
1 楼
不同的client之间如何共享数据?
比如我现在有一个List,有一个stateful sessionbean可以访问这个list
在servlet中,会初始化一个static sessionbean instance
servlet will call method in this sessionbean to get the list
So every web client will ask servlet for this list
(this list is not persisted)
My problem is, it seems like I will get concurrentaccess exception
because if several clients happen to ask for the servlet for the same time.
What's the correct/simple way to implement such scenario?
比如我现在有一个List,有一个stateful sessionbean可以访问这个list
在servlet中,会初始化一个static sessionbean instance
servlet will call method in this sessionbean to get the list
So every web client will ask servlet for this list
(this list is not persisted)
My problem is, it seems like I will get concurrentaccess exception
because if several clients happen to ask for the servlet for the same time.
What's the correct/simple way to implement such scenario?