NetBeans 自动更改连接池设置

发布于 2024-12-24 17:57:02 字数 362 浏览 1 评论 0原文

我正在使用 glassfish 和 netbeans 6.9.1 开发 Web 应用程序。我已经从 netbeans 中的数据库生成了持久性单元、实体和 jpa 控制器类。我的数据库的连接池是由 netbeans 自动生成的(我在“从数据库新建实体类”对话框中选择了“新数据源...”)。 现在我必须调整连接池中的一些设置以使其与我的应用程序一起工作,并且在重新部署期间,netbeans 会将这些设置更改为创建时所做的设置。 当我更改 jndi 中的连接池时,它也被设置为默认值。 当我通过 Glassfish 管理控制台重新部署我的应用程序时,一切都保持不变。 每次都手动部署应用程序是很烦人的。您能否告诉我是否有某种方法可以阻止 netbeans 更改连接池设置?

提前致谢, 皮奥特里克

I'm developing web application with glassfish and netbeans 6.9.1. I have generated persistence unit, entities and jpa controller classes from database in netbeans. Connection Pool to my database was automatically generated by netbeans (I've chosen "New Datasource..." in New Entity Classes from Database dialog).
Now I have to tune some settings in connection pool to get it work with my app and, during redeploy, netbeans is changing those settings to those made while creation.
When I change connection pool in jndi, it is being set to default also.
When I redeploy my app via Glassfish Admin Console, everything remains unchanged.
It is quite annoying to deploy application each time manually. Could You please tell me if there is some way to prevent netbeans from changing connection pool settings?

Thanks in advance,
Piotrek

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染年凉城似染瑾 2024-12-31 17:57:03

要让 NB 在重新部署期间停止更新连接池设置,请执行以下操作:

  1. 找到项目中名为“服务器资源”的子节点并将其展开。

  2. 删除名为 sun-resources.xml 的文件。

如果您编辑该文件,则可以强制 NB 更新设置以匹配您使用管理控制台调整的值。

这可能是一个更好的选择,因为这允许您与其他开发人员共享这些设置,并在您开始将应用程序部署到不同的服务器上时从部署的自动资源创建功能中受益。

To have NB stop updating the connection pool settings during redeployment do the following:

  1. Find the sub-node of your project named 'Server Resources' and expand it.

  2. Delete the file named sun-resources.xml.

If you edit the file, you can force NB to update the settings to match the values that you have tuned with the admin console.

This may be a better choice, since this allows you to share these settings with other developers and benefit from the automatic resource creation feature of deployment if you start to deploy your app onto a different server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文