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 6564385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:57:36+00:00 2026-05-25T13:57:36+00:00

I have one or 2 queries that take ~ 10 minutes to execute. How

  • 0

I have one or 2 queries that take ~ 10 minutes to execute.

How do I manipulate the $db object to include timeouts?

$_SESSION['params'] = array(
 'host'           => '127.0.0.1',
 'username'       => 'sa',
 'password'       => 'password',
 'dbname'         => 'schema',
 'driver_options'        => $options
);
$db = createConnection($_SESSION['params']);

function createConnection( $params){
    return Zend_Db::factory('Pdo_MSsql', $params);
}
  • 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-25T13:57:37+00:00Added an answer on May 25, 2026 at 1:57 pm

    I’m not familiar with the PDO_MSSQL adapter, but according to the documentation, you can use the driver_options parameter to add specific options to the adapter. See the example #7 in http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapter.connecting.parameters

    If there is a PDO_MSSQL parameter to set the timeout, you should be able to set it there.

    EDIT:

    There seems to be a PDO::ATTR_TIMEOUT attribute. According to the PHP documentation:

    PDO::ATTR_TIMEOUT: Specifies the timeout duration in seconds. Not all drivers support this option, and it’s meaning may differ from driver to driver. For example, sqlite will wait for up to this time value before giving up on obtaining an writable lock, but other drivers may interpret this as a connect or a read timeout interval. Requires int.

    EDIT2:

    There seems to be a custom attribute for the pdo_mssql driver. According to this blog entry:

    Developers can set the query timeout using the PDO::SQLSRV_ATTR_QUERY_TIMEOUT per connection and per statement, and exploit it to provide a better user experience in their applications.

    Hope that helps,

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

Sidebar

Related Questions

So for this one project, we have a bunch of queries that are executed
I have a couple of queries for a web site that take a long
I have a database where one of the common queries is has a where
I have one field that I need to sum lets say named items However
I have one thread that writes results into a Queue. In another thread (GUI),
I have one hibernate sequence, that generates all sequence-numbers in my app. When I
I have an application that queries a web service by a date range. The
I have a sequence of sql queries that result in very large datasets that
I have one Linq to SQL query that simply joins three tables and then
I have a server-side code written in Node.js that makes 6 SQL queries in

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.