简体   繁体   English

使用Hibernate从两个不同的Web应用程序(GXT)连接同一数据库

[英]Connecting the same database from two different web applications(GXT) using Hibernate

I am working with two different web applications built upon GXT. 我正在使用基于GXT构建的两个不同的Web应用程序。 But the problem is that both the applications are accessing the same database and the hibernate is not allowing to do so when we tried to deploy together in Apache Tomcat and then access them simultaneously. 但是问题在于,当我们尝试在Apache Tomcat中一起部署然后同时访问它们时,两个应用程序都在访问同一个数据库,并且休眠状态不允许这样做。 Can you tell me how can we access the same database using hibernate from both the applications? 您能告诉我如何使用两个应用程序中的休眠方式访问同一数据库吗? We are using c3p0 connection pool for this. 我们为此使用c3p0连接池。

(...) Hibernate is not allowing to do so when we tried to deploy together in Apache Tomcat and then access them simultaneously. (...)当我们尝试在Apache Tomcat中一起部署然后同时访问它们时,Hibernate不允许这样做。

And what was the problem? 那是什么问题呢? What error did you get? 您遇到什么错误? Provide some details might help to get an answer. 提供一些详细信息可能有助于获得答案。

Can you tell me how can we access the same database using hibernate from both the applications? 您能告诉我如何使用两个应用程序中的休眠方式访问同一数据库吗? We are using c3p0 connection pool for this. 我们为此使用c3p0连接池。

Just do it, I don't see anything blocking here (which is why answering the mentioned questions will help). 就是这样做,我在这里看不到任何障碍(这就是为什么回答上述问题会有所帮助的原因)。 Instantiating several SessionFactory in different JVMs is actually a very common scenario (eg when running a single application on a cluster, which is technically equivalent to your scenario). 实际上,在不同的JVM中实例化几个SessionFactory是一个非常常见的场景(例如,在集群上运行单个应用程序时,从技术上讲,这等效于您的场景)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Hibernate将两个或多个应用程序连接到同一个数据库 - Connect two or more applications to the same database using Hibernate 使用 hibernate 在不同的应用程序上更新同一个表 - Updating the same table on the different applications using hibernate 两个不同的Java应用程序共享同一个数据库 - Two different Java applications sharing the same database Hibernate:在同一个应用程序中使用两个不同的DataBase模式 - Hibernate: Using two different DataBase schemas in the same application 2 使用不同 hibernate 版本但相同 oracle 数据库的应用程序抛出唯一约束错误 - 2 Applications using different hibernate versions but same oracle database throwing unique constraint error 使用sapjco连接到SAP BAPI的两个Web应用程序 - Two web applications connecting to SAP BAPI using sapjco 同一个数据库的不同应用 - Different applications to the same database 两个应用程序在Hibernate Search中使用相同的索引文件 - Two Applications using the same index file with Hibernate Search 在具有自己的数据库的3个不同的Web应用程序中进行相同的身份验证 - Same authentication in 3 different web applications, that have their own database 在具有相同主机但不同端口的 eclipse 中运行两个 web 应用程序 - Running two web applications in eclipse with same host but different ports
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM