Skip to content
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.

example for sharding-transaction-xa-narayana. #143

Open
1 task
cherrylzhao opened this issue May 27, 2019 · 7 comments
Open
1 task

example for sharding-transaction-xa-narayana. #143

cherrylzhao opened this issue May 27, 2019 · 7 comments
Assignees

Comments

@cherrylzhao
Copy link
Member

narayana have provided a powerful feature to persistence transaction log into database, and do recovery in background thread. we'd like to write a example for it.

  • sharding-transaction-xa-narayana-raw-jdbc
@zhfeng
Copy link

zhfeng commented May 31, 2019

@cherrylzhao I just want to know how to run the example of transaction-xa-raw-jdbc-example ?
for narayana example, I think it could be add the profile to include the dependency

<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-transaction-xa-narayana-manager</artifactId>

and if we want to use the jdbc to save the transaction log, we need to include the jbosstx-properties.xml which contains the jdbc configuration.

@cherrylzhao
Copy link
Member Author

first create schema in your local mysql using manual_schema.sql
then run the YamlConfigurationTransactionExample is ok.

@zhfeng
Copy link

zhfeng commented Jun 3, 2019

Well, how to run YamlConfigurationTransactionExample ? I tried

java -jar target/transaction-xa-raw-jdbc-example-4.0.0-RC2-SNAPSHOT.jar

but it looks like "target/transaction-xa-raw-jdbc-example-4.0.0-RC2-SNAPSHOT.jar中没有主清单属性"

mvn exec:java -Dexec.mainClass="org.apache.shardingsphere.example.transaction.xa.raw.jdbc.YamlConfigurationTransactionExample"

java.lang.NullPointerException
    at org.apache.shardingsphere.example.transaction.xa.raw.jdbc.YamlConfigurationTransactionExample.getFile (YamlConfigurationTransactionExample.java:52)
    at org.apache.shardingsphere.example.transaction.xa.raw.jdbc.YamlConfigurationTransactionExample.main (YamlConfigurationTransactionExample.java:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
    at java.lang.Thread.run (Thread.java:748)

It looks like it can not find the configuration yaml file in the class resources. So can you show me the commands to run this example ?

@cherrylzhao
Copy link
Member Author

we usually run the YamlConfigurationTransactionExample within idea.
if you want to run in command line, you should assembly it using maven-assembly-plugin

@cherrylzhao
Copy link
Member Author

I think you can reference the assembly script of jdbc-performance-test

@zhfeng
Copy link

zhfeng commented Jun 3, 2019

Thanks @cherrylzhao - I will try this test. Anyway, it could be very helpful to add some documentation to describe how to run the example even within the IDE.

@cherrylzhao
Copy link
Member Author

ok, I will consider about it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants