Subject | Some bugs and patches |
---|---|
Author | Blas Rodriguez Somoza |
Post date | 2002-05-15T02:52:45Z |
Hello
I spend some time testing the driver and I locate some bugs and it solutions. I send the methods affected in a text file with
the mail. I refresh my CVS repository on May-14 at 21:52 (Madrid Time) so I think I make the changes on the current version.
With this patches, the driver passes all the tests for PreparedStatement. Otherwise, the bug about the statement closing have
some serious consecuences, between which it is that the driver locks a table and when after some other work, the program tries to
close the connection, the method fails with an exception.
1.- FBPreparedStatement.internalExecute.
BUG: a preparedStatement with the parameters cleared don't throw SQLexception when executed.
WHY: there is two internalExecute methods but only one is used. There are a parameters check in the wrong method
"internalExecute(String)". PATCH: copy the parameter check to the correct method "internalExecute(boolean)". I think it is better to
comment the unused method to avoid confusion.
2.- FBStatement.getResultSet()
BUG: When getResultSet is called after a execute(insert/update/delete) the driver throws an error "registerStatement called with no
transaction".
WHY: The driver try to return a new resultSet but it can't.
PATCH: Now there are some code to try to get more than one resultSet, but the driver does not implement getMoreResults and I don't
know if the driver and Firebird can return multiple results with one execute. The solution is to return null if there is no
cachedResultSet, this behavoir is the one the specification expects if there is no more resultSets.
3.- FBStatement.getMoreResults()
BUG: Not implemented
PATCH: return null.
4.- FBStatement.execute/executeQuery/executeUpdate
BUG: The execute methods does not verify if the Statement is closed.
PATCH: verify if the Statement is closed at the beggining of the three execute methods and return an SQLException if the statement
is closed.
5.- FBStatement.close
BUG: If an Statement is closed before it is used to execute a SQL command, the close method does not set closed=true because
fixedStmt is null.
PATCH: set closed=true in close() method if fixedStmt is false.
6.- FBConnection.setTransactionIsolation
BUG: If a transaction isolation level is not supported, the driver must upgrade the level to the next higher level, and if there is
no one then it must throw a SQLException.
PATCH: If READ_UNCOMMITTED isolation level is required then the driver set the level to READ_COMMITTED.
Regards
Blas Rodriguez Somoza.
I spend some time testing the driver and I locate some bugs and it solutions. I send the methods affected in a text file with
the mail. I refresh my CVS repository on May-14 at 21:52 (Madrid Time) so I think I make the changes on the current version.
With this patches, the driver passes all the tests for PreparedStatement. Otherwise, the bug about the statement closing have
some serious consecuences, between which it is that the driver locks a table and when after some other work, the program tries to
close the connection, the method fails with an exception.
1.- FBPreparedStatement.internalExecute.
BUG: a preparedStatement with the parameters cleared don't throw SQLexception when executed.
WHY: there is two internalExecute methods but only one is used. There are a parameters check in the wrong method
"internalExecute(String)". PATCH: copy the parameter check to the correct method "internalExecute(boolean)". I think it is better to
comment the unused method to avoid confusion.
2.- FBStatement.getResultSet()
BUG: When getResultSet is called after a execute(insert/update/delete) the driver throws an error "registerStatement called with no
transaction".
WHY: The driver try to return a new resultSet but it can't.
PATCH: Now there are some code to try to get more than one resultSet, but the driver does not implement getMoreResults and I don't
know if the driver and Firebird can return multiple results with one execute. The solution is to return null if there is no
cachedResultSet, this behavoir is the one the specification expects if there is no more resultSets.
3.- FBStatement.getMoreResults()
BUG: Not implemented
PATCH: return null.
4.- FBStatement.execute/executeQuery/executeUpdate
BUG: The execute methods does not verify if the Statement is closed.
PATCH: verify if the Statement is closed at the beggining of the three execute methods and return an SQLException if the statement
is closed.
5.- FBStatement.close
BUG: If an Statement is closed before it is used to execute a SQL command, the close method does not set closed=true because
fixedStmt is null.
PATCH: set closed=true in close() method if fixedStmt is false.
6.- FBConnection.setTransactionIsolation
BUG: If a transaction isolation level is not supported, the driver must upgrade the level to the next higher level, and if there is
no one then it must throw a SQLException.
PATCH: If READ_UNCOMMITTED isolation level is required then the driver set the level to READ_COMMITTED.
Regards
Blas Rodriguez Somoza.