Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction Tag? #17

Open
hansgru opened this issue May 21, 2015 · 3 comments
Open

Transaction Tag? #17

hansgru opened this issue May 21, 2015 · 3 comments

Comments

@hansgru
Copy link

hansgru commented May 21, 2015

Is there a way to specify transactions in the processing and not just globally on the entire connection? Maybe with some tag or some script? Or when certain conditions are met in a script/query?

e.g. something like:

<connection id="in" driver="org.h2.Driver"/>
<connection id="out" driver="org.h2.Driver"/>

<query connection-id="in">
   select col11, col12, col13 from table1_in
   <script connection-id="out">
        insert into table1_out (col11_out, col12_out, col13_out) values (?col11,?col12,?col13)
   </script>
</query>

<query connection-id="in">
   select col21, col22, col23 from table2_in
   <script connection-id="out">
        insert into table2_out (col21_out, col22_out, col23_out) values (?col21,?col22,?col23)
   </script>
</query>

<!-- Commit after the first 2 tables are ready! -->
<commit/>

<query connection-id="in">
   select col31, col32, col33 from table3_in
   <script connection-id="out">
        insert into table3_out (col31_out, col32_out, col33_out) values (?col31,?col32,?col33)
   </script>
</query>

<query connection-id="in">
   select col41, col42, col43 from table4_in
   <script connection-id="out">
        insert into table4_out (col41_out, col42_out, col43_out) values (?col41,?col42,?col43)
   </script>
</query>

<!-- Another Commit ! -->
<commit/>

<query connection-id="in">
   select col51, col52, col53 from table5_in
   <script connection-id="out">
        insert into table5_out (col51_out, col52_out, col53_out) values (?col51,?col52,?col53)
   </script>
</query>

Thank you.

@bhuesemann
Copy link

I've added this functionality in this pull (#7). I called it query based commit (sounds kind of strange, but it essentially triggers a commit around finishing a query element). Hope to find the time to fix the comments for that pull request.

@hansgru
Copy link
Author

hansgru commented May 26, 2015

@bhuesemann
This sounds good.

I hope it gets merged soon.

Any examples how to use it? The diffs do not show any docs changes regarding this issue.

@aadrian
Copy link

aadrian commented May 30, 2015

+1

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

No branches or pull requests

3 participants