Export to GitHub

mybatisnet - issue #10

R15 Command Timeout maybe not fixed


Posted on Aug 25, 2010 by Quick Elephant

I have checked only code change, I do not try to it run or test, but I think, that there is still a problem in fix revision 15.

http://code.google.com/p/mybatisnet/source/detail?r=15 in method CreateCommand - see bellow

there is a new line: command.CommandTimeout = _dataSource.DbProvider.DbCommandTimeout;

which set command-timeout from provider setting. OK

But in case of connection is not null, following lines in this method set it back to connection timeout:

if (_connection!= null) { try // MySql provider doesn't suppport it ! { command.CommandTimeout = _connection.ConnectionTimeout; }

....

<code> public IDbCommand CreateCommand(CommandType commandType) { IDbCommand command = _dataSource.DbProvider.CreateCommand(); command.CommandTimeout = _dataSource.DbProvider.DbCommandTimeout; command.CommandType = commandType; command.Connection = _connection;

// Assign transaction if (_transaction != null) { try { command.Transaction = _transaction; } catch {} } // Assign connection timeout if (_connection!= null) { try // MySql provider doesn't suppport it ! { command.CommandTimeout = _connection.ConnectionTimeout; } catch(NotSupportedException e) { if (_logger.IsInfoEnabled) { _logger.Info(e.Message); } } }

// if (_logger.IsDebugEnabled) // { //command = IDbCommandProxy.NewInstance(command); // }

return command; }

</code>

Status: New

Labels:
Type-Defect Priority-Low