Skip to content

Commit

Permalink
workaround for #7117 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Jun 23, 2023
1 parent 197c7ce commit c6d5914
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Standard.Base.Errors.Illegal_Argument.Illegal_Argument
import Standard.Base.Errors.Illegal_State.Illegal_State
import Standard.Base.Errors.Unimplemented.Unimplemented
import Standard.Base.Runtime.Managed_Resource.Managed_Resource
import Standard.Base.Runtime.Context

import Standard.Table.Data.Table.Table as Materialized_Table
import Standard.Table.Data.Type.Value_Type.Value_Type
Expand Down Expand Up @@ -39,7 +40,19 @@ type JDBC_Connection
Runs the provided action ensuring that no other thread is working with
this Connection concurrently.
synchronized self ~action =
callback = _ -> action
# We save and restore context information. This is a workaround for bug #7117.
restore_context context =
saved_setting = context.is_enabled
~action ->
case saved_setting of
True -> context.with_enabled action
False -> context.with_disabled action
restore_output = restore_context Context.Output
restore_input = restore_context Context.Input
callback _ =
restore_input <|
restore_output <|
action
self.operation_synchronizer.runSynchronizedAction callback

## PRIVATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ check_target_table_for_update target_table ~action = case target_table of
Assumes that `source_table` is a simple table query without any filters,
joins and other composite operations - if a complex query is needed, it
should be first materialized into a temporary table.

If `dry_run` is set to True, only the checks are performed, but the
operations actually modifying the target table are not.
append_to_existing_table source_table target_table update_action key_columns dry_run = In_Transaction.ensure_in_transaction <|
helper = Append_Helper.Context source_table target_table key_columns dry_run
upload_status = case update_action of
Expand Down

0 comments on commit c6d5914

Please sign in to comment.