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

SQL transaction #292

Open
TomatorCZ opened this issue Oct 19, 2021 · 10 comments
Open

SQL transaction #292

TomatorCZ opened this issue Oct 19, 2021 · 10 comments
Assignees
Labels
documentation Documentation may be added or completed on the portal enhancement New feature or request

Comments

@TomatorCZ
Copy link

TomatorCZ commented Oct 19, 2021

Hi,

Is there a way how to make transaction processing in SQL ?
Is there a way how to skip failed rows which were failed and continue with inserting next rows ?

@paillave
Copy link
Owner

About the SQL transaction, you have to handle it on top of the ETL process. Nothing is planed for now to handle sub transaction within the process.

To skip failed rows, I can do something for this in a future release. You are working with entity framework extension or with direct sql extension?

Can you submit an example of your code for me to have a more precise idea of what you expect?

@paillave paillave self-assigned this Oct 20, 2021
@paillave paillave added enhancement New feature or request question Further information is requested documentation Documentation may be added or completed on the portal labels Oct 20, 2021
@TomatorCZ
Copy link
Author

I already made it in a new operator.

Thanks

@paillave
Copy link
Owner

I already made it in a new operator.

Thanks

Ok good. Did you find the documentation clear enough for this purpose?

@TomatorCZ
Copy link
Author

TomatorCZ commented Oct 26, 2021

Yes. It took me some time to understand the architecture but after that the documentation was enough.
The architecture is very nice!

@TomatorCZ
Copy link
Author

Can you execute the ExecuteNonQueryAsync in a transaction when it is provided by the database?

Reason

I try to execute the Delete(EFCore) operator within a transaction scope, but it throws an error, due to this command.
Setting its Transaction property based on the Database should fix this.

var dbCommand = dbCtx.CreateCommand();

@paillave
Copy link
Owner

@TomatorCZ , I created an issue, I'll work on it asap.

@paillave
Copy link
Owner

paillave commented Apr 26, 2022

@TomatorCZ Can you give me the exact exception stack you have?
Because according to me, any command running within the TransactionScope should run against it.

@TomatorCZ
Copy link
Author

@paillave
I think that TransactionScope works fine when you have just one DbContext.

In a scenario, where you have multiple contexts and you want to perform something like distributed transaction, you cannot use this class yet in .NET Core(dotnet/runtime#715).
So I created two separate transactions and committed them at the end of the section. But this way of implementation requires additional treatment which I described above.

I hope it is helpful

@paillave
Copy link
Owner

paillave commented Apr 29, 2022

@paillave I think that TransactionScope works fine when you have just one DbContext.

In a scenario, where you have multiple contexts and you want to perform something like distributed transaction, you cannot use this class yet in .NET Core(dotnet/runtime#715). So I created two separate transactions and committed them at the end of the section. But this way of implementation requires additional treatment which I described above.

I hope it is helpful

So (I reformulate to ensure I get it right) you mean you don't use distributed transaction as for now, EF Core can't handle it the way you want. Then you try to use a workaround to (somehow) simulate the distributed transaction behavior. This workaround is to make 2 ado.net transactions that you set to their respective context and that you manage manually. Am I right?

@TomatorCZ
Copy link
Author

Yes, exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation may be added or completed on the portal enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants