Skip to main content
added 5 characters in body
Source Link
Tristan
  • 207
  • 2
  • 9

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions  ? My group of committed records is not a logical group (the size of this group is set up using commit-interval property) : it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rolling back 100 independent operations when one fails ?

If my question is not clear enough, let's take an example : I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs  ? What am I losing doing so  ?

Best answer I've found to this so far is  : batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true  ?

I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions? My group of committed records is not a logical group (the size of this group is set up using commit-interval property) : it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rolling back 100 independent operations when one fails ?

If my question is not clear enough, let's take an example : I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs? What am I losing doing so?

Best answer I've found to this so far is: batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true?

I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions  ? My group of committed records is not a logical group (the size of this group is set up using commit-interval property) : it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rolling back 100 independent operations when one fails ?

If my question is not clear enough, let's take an example : I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs  ? What am I losing doing so  ?

Best answer I've found to this so far is  : batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true  ?

I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

Typoes, no space before punctuation in English, rephrased last sentence & removed edit marker
Source Link
Tristan
  • 207
  • 2
  • 9

What is the usefulness of transactions in a batch (especially a Spring batch)?

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions? My group of committed records is not a logical group (the size of this group is set up using commit-interval property)  : it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rolling back 100 independent operations when one fails  ?

If my question is not clear enough, let's take an example  : I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs? What am I losing doing so?

Best answer I've found to this so far is: batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true?

I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

What is the usefulness of transactions in Spring batch?

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions? My group of committed records is not a logical group (the size of this group is set up using commit-interval property): it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rolling back 100 independent operations when one fails?

If my question is not clear enough, let's take an example: I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs? What am I losing doing so?

Best answer I've found to this so far is: batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true?

I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

What is the usefulness of transactions in a batch (especially a Spring batch)?

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions? My group of committed records is not a logical group (the size of this group is set up using commit-interval property)  : it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rolling back 100 independent operations when one fails  ?

If my question is not clear enough, let's take an example  : I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs? What am I losing doing so?

Best answer I've found to this so far is: batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true?

I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

Typoes, no space before punctuation in English, rephrased last sentence & removed edit marker
Source Link

What is the usefulness of transactions in (Spring)Spring batch?

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions  ? My group of commitedcommitted records is not a logical group (the size of this group is set up using commit-interval property)  : it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rollbackingrolling back 100 independantindependent operations when one fails  ?

If my question is not clear enough, let's take an example  : I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs  ? What am I losing doing so  ?

Best answer I've found to this so far is  : batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true  ?

EDIT : please no "RTFM" answers, I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

What is the usefulness of transactions in (Spring) batch?

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions  ? My group of commited records is not a logical group (the size of this group is set up using commit-interval property)  : it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rollbacking 100 independant operations when one fails  ?

If my question is not clear enough, let's take an example  : I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs  ? What am I losing doing so  ?

Best answer I've found to this so far is  : batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true  ?

EDIT : please no "RTFM" answers, I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how".

What is the usefulness of transactions in Spring batch?

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state.

But why is a framework like Spring Batch built around transactions? My group of committed records is not a logical group (the size of this group is set up using commit-interval property): it's not a problem if one fails and the others succeed. And in the contrary, if my commit-interval is 100, what's the purpose of rolling back 100 independent operations when one fails?

If my question is not clear enough, let's take an example: I have a job with a few steps, and each main step is about parsing some xml files and inserting fragments into DB. What will happen if all these steps run in no transaction, and any failing reading/processing/writing results in a caught exception and just produces some logs? What am I losing doing so?

Best answer I've found to this so far is: batch transactions are not logical transactions, they are about performance, you can't process item in chunks without transactions, is that true?

I understand how to set up transactions and I've wrote a few jobs already, my question is not about "how" but about "why".

Source Link
Tristan
  • 207
  • 2
  • 9
Loading