]
James Perkins updated WFLY-12099:
---------------------------------
Labels: closed (was: )
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
Labels: closed
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@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@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@embedded /] /subsystem=transactions/log-store=log-store:remove
{
"outcome" => "success",
"result" => undefined
}
[standalone@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@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