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 the following queries, which method would you consider the better one? What
Out of habit I tend to put classes/structs/enumerations in separate files when not nested.
when programming in Java I practically always, just out of habit, write something like
I have recently developed a habit of running all of my programs through valgrind
Out of curiosity is it possible to do something like this using NHibernate 3?
Out of the box, in MS Reporting Services, the image element does not allow
Out of the box SSRS reports cannot have data exposed in the page header.
Out of order execution in CPUs means that a CPU can reorder instructions to
Out style: bool result; if(something.TryParse(val, out result)) { DoSomething(result); } Nullable style: bool? result
Out of the several ways of accessing the SharePoint model of a SharePoint Services

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.