[jboss-jira] [JBoss JIRA] (WFLY-12121) Transaction JDBC object store CLI operation fails when set to false with information JDBC connection is needed
Ondrej Chaloupka (Jira)
issues at jboss.org
Fri May 24 05:30:00 EDT 2019
[ https://issues.jboss.org/browse/WFLY-12121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13738108#comment-13738108 ]
Ondrej Chaloupka commented on WFLY-12121:
-----------------------------------------
Ok, I found out that this error does not come from the transaction code. Handlers there checks if the value is about to be set to {{true}} and only in such case, it shows the error.
https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystemRootResourceDefinition.java#L439
{code}
...
if (modelNode.hasDefined(USE_JDBC_STORE.getName()) && modelNode.get(USE_JDBC_STORE.getName()).asBoolean()
...
{code}
The error comes from the generic handler that checks what is defined by {{setRequires(...)}}
https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystemRootResourceDefinition.java#L228
where it's defined
{code}
.setRequires(CommonAttributes.JDBC_STORE_DATASOURCE)
{code}
The handler where the exception is thrown from is at WFLY Core at {{ValidateModelStepHandler}}
https://github.com/wildfly/wildfly-core/blob/9.0.0.Beta6/controller/src/main/java/org/jboss/as/controller/ValidateModelStepHandler.java#L280
Now I wonder if the generic handler {{ValidateModelStepHandler}} could be wrong that it does not allow the usage of the {{false}} and still requires what is defined as 'requires'. Or if in my case the {{seRequires}} should not be used as it's a specific logic which is expected to be done "manually" at {{TransactionSubsystemRootResourceDefinition}}?
Would you have some tip for me on this [~kabirkhan][~brian.stansberry]? Thanks
> Transaction JDBC object store CLI operation fails when set to false with information JDBC connection is needed
> --------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-12121
> URL: https://issues.jboss.org/browse/WFLY-12121
> Project: WildFly
> Issue Type: Bug
> Components: Transactions
> Reporter: Ondrej Chaloupka
> Assignee: Ondrej Chaloupka
> Priority: Minor
>
> If the JDBC store is for to be disabled it's needed to be used CLI command
> {code}
> /subsystem=transactions:write-attribute(name=use-jdbc-store, value=false)
> {code}
> (see documentation https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.2/html-single/managing_transactions_on_jboss_eap/index#using_jdbc_datasource_as_transactions_object_store)
> but when a data source is not configured then even when it's to be set to false there is an error that such operation is not possible
> {code}
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0380: Attribute 'jdbc-store-datasource' needs to be set or passed before attribute 'use-jdbc-store' can be correctly set",
> "rolled-back" => true
> }
> {code}
> I would expect that when I want to disable the jdbc store I don't need to provide a data source for a connection before. Setting-up the {{false}} should not throw an error in CLI.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list