[jboss-jira] [JBoss JIRA] (WFLY-12099) Cannot change transaction log store type via CLI
Ondrej Chaloupka (Jira)
issues at jboss.org
Fri May 24 04:55:00 EDT 2019
[ https://issues.jboss.org/browse/WFLY-12099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13738075#comment-13738075 ]
Ondrej Chaloupka edited comment on WFLY-12099 at 5/24/19 4:54 AM:
------------------------------------------------------------------
Hi [~kabirkhan],
I'm sorry for not getting to this sooner. But with your permission, I'm closing this as not a bug. If you consider that's not correct feel free to reopen and we can discuss more.
The way how to set up the JDBC object store is explained in steps in doc (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) so from the technical perspective I would mention that it's needed to be used the operation {{/subsystem=transactions:write-attribute(name=use-jdbc-store, value=true)}}. The operation should change the datastore type from the default/journal to jdbc.
For the JDBC that the datasource is defined to be with {{jta}} set to {{false}}.
For set up the horneq/journal there is equivalent command
{{/subsystem=transactions:write-attribute(name=use-journal-store, value=true)}}
To set the default one you need to run "back" with false.
{{/subsystem=transactions:write-attribute(name=use-journal-store, value=false)}}
I understand that the usage of the CLI is not intuitive as it does not follow how other subsystems are configured. But that's all that I'm able to say to it. I just do how it was done.
was (Author: ochaloup):
Hi [~kabirkhan],
I'm sorry for not getting to this sooner. But with your permission, I'm closing this as not a bug. If you consider that's not correct feel free to reopen and we can discuss more.
The way how to set up the JDBC object store is explained in steps in doc (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) so from the technical perspective I would mention that it's needed to be used the operation {{/subsystem=transactions:write-attribute(name=use-jdbc-store, value=true)}}. Ensure that the datasource is defined to be with {{jta}} set to {{false}}.
I understand that the usage of the CLI is not intuitive as it does not follow how other subsystems are configured. But that's all that I'm able to say to it. I just do how it was done.
> Cannot change transaction log store type via CLI
> ------------------------------------------------
>
> Key: WFLY-12099
> URL: https://issues.jboss.org/browse/WFLY-12099
> Project: WildFly
> Issue Type: Bug
> Components: Transactions
> Affects Versions: 17.0.0.Alpha1
> Reporter: Kabir Khan
> Assignee: Ondrej Chaloupka
> Priority: Critical
>
> For the OpenShift image work we need to be able to handle configuration of datasources. There is an effort underway to replace the current template marker replacement done in standalone.xml with CLI commands.
> While this works for the datasource subsystem itself, the OpenShift image scripts also touch other subsystems. For example if it is configured to use the Tx subsystem JDBC log store, we need to change the value of the /subsystem=transactions/log-store=log-store's 'type' attribute and to set the values of jdbc-action-store-table-prefix, jdbc-communication-store-table-prefix and jdbc-state-store-table-prefix and jdbc-store-datasource attributes on the subsystem itself.
> The equivalent in the existing xml marker replacement is to inject the following xml into the subsystem (the 'os77c791d37250' is calculated by the OpenShift launch scripts):
> {code}
> <jdbc-store datasource-jndi-name="java:jboss/datasources/testtx_postgresqlObjectStore">
> <action table-prefix="os77c791d37250"/>
> <communication table-prefix="os77c791d37250"/>
> <state table-prefix="os77c791d37250"/>
> </jdbc-store>
> {code}
> However, this is not possible to do via CLI. Starting the server without a jdbc-store, you end up with the following
> {code}
> [standalone at localhost:9990 /] /subsystem=transactions/log-store=log-store:read-resource
> {
> "outcome" => "success",
> "result" => {
> "type" => "default",
> "transactions" => undefined
> }
> }
> {code}
> If you try to write the 'type' attribute it gives the error than it is read-only
> {code}
> [standalone at embedded /] /subsystem=transactions/log-store=log-store:write-attribute(name=type, value=jdbc)
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0048: Attribute type is not writable",
> "rolled-back" => true
> }
> {code}
> If you try to delete the resource and add it again, it gives another error:
> {code}
> [standalone at embedded /] /subsystem=transactions/log-store=log-store:remove
> {
> "outcome" => "success",
> "result" => undefined
> }
> [standalone at embedded /] /subsystem=transactions/log-store=log-store:add(type=jdbc)
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0212: Duplicate resource [
> (\"subsystem\" => \"transactions\"),
> (\"log-store\" => \"log-store\")
> ]",
> "rolled-back" => true
> }
> {code}
> Despite the change looking like it has taken effect:
> {code}
> [standalone at embedded /] /subsystem=transactions/log-store=log-store:read-resource
> {
> "outcome" => "success",
> "result" => {
> "type" => "jdbc",
> "transactions" => undefined
> }
> }
> {code}
> However, it is not persisted in xml, so restarting the server it says the type is 'default' again
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list