如何动态地将数据源添加到jboss 7 [英] How to dynamically add datasources to jboss 7

查看:176
本文介绍了如何动态地将数据源添加到jboss 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,它为应用程序的每个实例动态添加数据库,然后在JBoss 5上将数据源文件写入deploy文件夹,以便应用程序可以使用新数据库(并且锁定它。)

I have an application which dynamically adds databases for each instance of the application, and which then, on JBoss 5 would write a datasource file out into the deploy folder, so that the application could make use of the new database (And be locked down to it).

在JBoss 7中,数据源配置在standalone.xml中。更重要的是,如果我在这个文件中输入新的数据源,它们似乎没有被读取,也没有可用的数据源。

In JBoss 7 the datasource configuration is inside standalone.xml. And more importantly if I enter new datasources into this file, they don't seem to get read and no datasource is available.

有没有人知道如何重现这种行为一旦我们升级到JBoss 7?

Does anyone have any idea how I can reproduce this behaviour once we upgrade to JBoss 7?

推荐答案

在较新版本的JBoss中,AS7 -ds.xml策略可行。

In newer version of JBoss AS7 -ds.xml strategy will work.

但管理CLI为您提供了另一种方式来执行它(因为它们可能不是扫描延迟,它可能是一种更推荐的方式)。

But management CLI offer you another way to perform it (as they will be no scanning delay it is probably a more recommended way).

您可以使用命令文件调用jboss-cli.sh(详细说明如何执行此操作: http://planet.jboss.org/post/how_to_create_an_manage_datasources_in_as7 )或者您可以直接使用本机API(https://docs.jboss.org/author/display/AS71/The+ native + management + API)。

You can either call jboss-cli.sh with command file (detail on how to do it can be found here: http://planet.jboss.org/post/how_to_create_an_manage_datasources_in_as7) or you can use the directly the native API (https://docs.jboss.org/author/display/AS71/The+native+management+API).

除了添加后面的方法,你将能够查询现有的数据酸ces并更新它们。

With the later method in addition to add, you will be able to query the existing data sources and update them.

这篇关于如何动态地将数据源添加到jboss 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆