Forums Register Login

should we begin and end a transaction for select statement?

+Pie Number of slices to send: Send
Hi
Thank you for reading my post
When we need to issue a select statement with a prepared statement, should we begin a transaction before we execute the statement and end after execution finished?

Can we only set isolation level and do not start a transaction for select statement?

Thanks
+Pie Number of slices to send: Send
There is no need for a transaction when doing a single select statement. The single statement is a transaction in itself. *As long as it's not doing other things*, if the select fails, nothing happens, if it succeeds, it commits - that's a pseudo-transaction there. Not needed.
If tomatoes are a fruit, then ketchup must be a jam. Taste this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 828 times.
Similar Threads
Transactions!
Which of the following statement will not implicitly begin a transaction?
EJB-QL and JBOSS-QL
transaction.commit() is this necessary if we didn't do any data manipulation on database?
How to extract number from one table and insert it into another table using MySQL
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:56:55.