English 中文(简体)
JPA分发的Java EE配置
原标题:JPA in distributed Java EE configuration

I m 编写 Java E申请,在玻璃鱼上运行:

  • Database (javaDB, MS SQL, MySQL or Oracle)
  • EJB layer with JPA (Toplink essentials - from Glassfish) for database access
  • JSF/Icefaces based web UI accessing the EJB layer

The application will have a lot of concurrent web client, so I want to run it on different physical servers and use a load-balancer. My problem is now how to keep the applications synchronized. I intend to set up multiple servers, each running Glassfish with my EAR app installed. Whenever on one of the servers data is added to or removed from the database (via JPA, no direct SQL queries), this change should be reflected in the JPA layer on the other servers.

I ve been looking around for solutions to this, but couldn t find anything I really like (the full Toplink from Oracle claims to have a solution, but don t know). Doing a refresh before every access to a JPA entity could work, but is far from efficient.

是否有任何模式、图书馆......可以帮助这里?

问题回答

每当一个服务器数据被输入数据库或从数据库中删除(通过邮管处,没有直接查询)时,这一变化应反映在其他服务器的邮管处一级。

我不理解维持现状,需要在“JPA”层面更新。 实体管理人员是孤立的,处理联合邮局的一致立场的方法是使用锁定(乐观主义或悲观主义,前者越大)。 或许你可以澄清你需要什么以及你看到什么。

See also





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签