Issue Details (XML | Word | Printable)

Key: ODBC-109
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Potapchenko
Reporter: Ivan Volnikov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ODBC Driver

Transaction stay in active status (retaining) after select (update) statement

Created: 28/Feb/11 03:32 PM   Updated: 31/May/12 04:54 PM
Component/s: None
Affects Version/s: 2.0 RC2
Fix Version/s: 2.0.1

File Attachments: 1. Zip Archive OdbcFb.zip (1.16 MB)

Environment: Linux 64, isql, UnixODBC, asterisk


 Description  « Hide
This problem leads to accumulation on server side of the locked transactions from other applications which completions not till the end of complete transactions expect.
All it leads to deceleration of operation of the server because of necessity to trace not up to the end closed transactions.
To be treated only by reconnection.
--------------------------------------------------------------------------
The problem is property autoCommit call commit_retaining instead of commit from method IscStatement::deleteResultSet.
--------------------------------------------------------------------------
void IscStatement::deleteResultSet(IscResultSet * resultSet)
{
        resultSets.deleteItem (resultSet);
        if (resultSets.isEmpty())
        {
                if ( connection )
                {
                        if ( transactionLocal )
                        {
                                if ( transactionInfo.autoCommit )
                                        commitLocal();
                        }
                        else if ( connection->transactionInfo.autoCommit )
                                connection->commitAuto();

                        if ( isActiveCursor() )
                        {
                                // Close cursors too.
                                ISC_STATUS statusVector[20];
                                connection->GDS->_dsql_free_statement( statusVector, &statementHandle, DSQL_close );
                                // Cursor already closed or not assigned
                                if ( statusVector[1] && statusVector[1] != 335544569)
                                        THROW_ISC_EXCEPTION (connection, statusVector);
                        }
                }
                openCursor = false;
                typeStmt = stmtNone;

        }
}
--------------------------------------------------------------------------
To solve the problem I use that:
--------------------------------------------------------------------------
void IscStatement::deleteResultSet(IscResultSet * resultSet)
{
        resultSets.deleteItem (resultSet);
        if (resultSets.isEmpty())
        {
                bool needCloseCursors = isActiveCursor();
                openCursor = false;
                typeStmt = stmtNone;

                if ( connection )
                {
                        if ( transactionLocal )
                        {
                                if ( transactionInfo.autoCommit )
                                        commitLocal();
                        }
                        else if ( connection->transactionInfo.autoCommit )
                                connection->commitAuto();

                        if ( needCloseCursors )
                        {
                                // Close cursors too.
                                ISC_STATUS statusVector[20];
                                connection->GDS->_dsql_free_statement( statusVector, &statementHandle, DSQL_close );
                                // Cursor already closed or not assigned
                                if ( statusVector[1] && statusVector[1] != 335544569)
                                        THROW_ISC_EXCEPTION (connection, statusVector);
                        }
                }

        }
}
--------------------------------------------------------------------------

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Potapchenko made changes - 05/Sep/11 02:38 PM
Field Original Value New Value
Attachment OdbcFb.zip [ 12007 ]
Alexander Potapchenko made changes - 05/Sep/11 09:16 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.0.1 [ 10430 ]
Resolution Fixed [ 1 ]
Alexander Potapchenko made changes - 31/May/12 04:54 PM
Status Resolved [ 5 ] Closed [ 6 ]