Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 644295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:22:31+00:00 2026-05-13T21:22:31+00:00

Out of habit I’ve been using try/catch blocks in my application code for all

  • 0

Out of habit I’ve been using try/catch blocks in my application code for all SQL queries, with a rollback at the beginning of the catch block. I’ve also been committing those which are successful. Is this necessary for SELECTs? Does it free up something on the database side? The select statements aren’t altering any data so it seems somewhat pointless, but perhaps there is some reason I’m not aware of.

e.g.

try {
  $results = oci_execute($statement)
  oci_commit($connection);
  return $results;
}
catch {
  oci_rollback($connection)
  throw new SqlException("failed");
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:22:32+00:00Added an answer on May 13, 2026 at 9:22 pm

    SELECT statements in Oracle (unless they are SELECT FOR UPDATE) never lock any records and never open transactions implicitly.

    Unless you issued any DML operations within your transaction, it will not matter whether you commit or roll back your transaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Out of curiosity I've been playing with jQuery to determine the browser's screen size,
Out of curiosity, I've been reading up a bit on the field of Machine
I am using Visual C# Express 2010 to develop an application for the Unity3D
A junior programmer in our office has an unfortunate (but understandable) habit of using
So I've gotten in the habit of using WPF/C# value converters because they are
I am always in the habit of using if, else-if statement instead of multiple
I have recently developed a habit of running all of my programs through valgrind
Very strange situation. check this out : billy@prog:~/sql$ grep -R temp_exchange *.sp billy@prog:~/sql$ grep
Out of habit I tend to put classes/structs/enumerations in separate files when not nested.
I've been using MVC frameworks for a short while now and I really like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.