• Post Reply Bookmark Topic Watch Topic
  • New Topic

should we begin and end a transaction for select statement?

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
John Melton
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!