Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic