简体   繁体   English

Mule JDBC数据源连接

[英]Mule JDBC Datasource connection

I have mule 3.5 db configuration as follows 我有如下的m子3.5 db配置

<spring:beans>
    <spring:bean id="pds" name="pds" class="com.mchange.v2.c3p0.ComboPooledDataSource" scope="singleton">
        <spring:property name="password" value="pwd"/>
        <spring:property name="jdbcUrl" value="jdbc:postgresql://localhost:5432/postgres"/>
        <spring:property name="user" value="user"/>
        <spring:property name="driverClass" value="org.postgresql.Driver"/>
    </spring:bean>
</spring:beans>
<db:generic-config name="Postgres_Datasource_Configuration"  transactionIsolation="READ_COMMITTED" doc:name="Generic Database Configuration" dataSource-ref="pds"/>

my flow looks like 我的流程看起来像

<flow name="JDBC-PostgresConfigurationWithDatasource" doc:name="JDBC-OracleConfigurationWithDatasource">
    <http:inbound-endpoint exchange-pattern="request-response"  host="localhost" port="8081" doc:name="HTTP" path="postgresInboundWithDS"/>
    <logger level="INFO" doc:name="Logger"/>
    <db:select config-ref="Postgres_Datasource_Configuration" doc:name="Database">
        <db:parameterized-query><![CDATA[SELECT * FROM employee]]></db:parameterized-query>
    </db:select>
    <mulexml:object-to-xml-transformer doc:name="Object to XML"/>
    <logger level="INFO" doc:name="Logger" message="#[payload]"/>
    <logger level="INFO" doc:name="Logger"/>
</flow>

I am always getting the error saying 我总是得到错误的说

The attributes of Element db:generic-config{dataSource-ref=pds, name=Generic Database Configuration, name=Postgres_Datasource_Configuration, transactionIsolation=READ_COMMITTED} do not match the exclusive groups [driver, url, connectionTimeout, transactionIsolation, useXaTransactions] [dataSource-ref] 元素db:generic-config {dataSource-ref = pds,name = Generic Database Configuration,name = Postgres_Datasource_Configuration,transactionIsolation = READ_COMMITTED}的属性与排他组不匹配[驱动程序,URL,connectionTimeout,transactionIsolation,useXaTransactions] [dataSource-参考]

What I didn't get is I mentioned dataSource-ref, but still it is showing error as mutually exclusive. 我没有得到的是我提到的dataSource-ref,但仍然显示错误是互斥的。
I observed the same behavior with oracle connector also. 我也观察到与oracle连接器相同的行为。

But I am able to connect to db when I am not using spring bean datasource. 但是当我不使用spring bean数据源时,我能够连接到db。

One more weird thing is, when I was working with mule 3.4 it worked fine. 另一件事是,当我使用I子3.4时,它工作正常。 Now, in 3.5 it is showing errors. 现在,在3.5中显示错误。


Am I missing anything? 我有什么想念的吗?

According to the error message, if you specify dataSource-ref , then you can't specify transactionIsolation . 根据错误消息,如果指定dataSource-ref ,则不能指定transactionIsolation

So remove the transactionIsolation from db:generic-config . 因此,从db:generic-config删除transactionIsolation

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM