Looks like the Statement batching does not work too well for arbitary queries with Sybase, although one of the guys at work did use batching to improve performance. In any case, I replaced this with code to build a list of queries from the include file, then run them all in sequence in a single transaction, so a failure will roll back the entire batch. This should work now with changes I put into CVS. There are changes in the following files:
M src/net/sourceforge/sqlunit/IErrorCodes.java
M src/net/sourceforge/sqlunit/IncludeHandler.java
M src/net/sourceforge/sqlunit/TeardownHandler.java
A test/sybase/teardown.sql
M test/sybase/test.xml
I think I will make a release pretty soon, so if you want you can wait for a full release, but meanwhile the code is in cvs.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now it's not throwing any error.But only the 1st statement gets executed.
For eg. If there are 2 delete statements are there then only 1st delete statement hget executed.But both delete statement is proper.
Please just check this and provide a solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My apologies, its fixed now in CVS. The only change is in the IncludeHandler.java code. I am trying to fold in some Oracle stuff for the next release, will probably release end of this week, so if you need this sooner, please get the CVS version.
Thanks for catching this.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you provide more details? Is it still the first SQL statement that gets executed? Does it throw any errors? At the risk of asking a real stupid question, did you recompile the code with ant install and move the sqlunit*.jar file to your classpath (ie where the old one was)? I am sure you must have done it, just trying to make sure.
Thanks
Sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is my RemoveData.sql file
delete from BillReqTbl1 where ReqId not in(select ReqId from RuqTbl)
;
delete from BillReqTbl2 where ReqId not in(select ReqId from RuqTbl)
;
=====
When I include this in the teardown it throwing an error
<teardown>
<include file="/UserTestCases/RemoveData.sql" />
</teardown>
Error message is
[sqlunit] com.sybase.jdbc.SybStatement.executeBatch()[I
[sqlunit] One or more SQLUnit Tests failed, see the console for details
Can someone just tell me what may be the problem
Thanks
sowmya
Looks like the Statement batching does not work too well for arbitary queries with Sybase, although one of the guys at work did use batching to improve performance. In any case, I replaced this with code to build a list of queries from the include file, then run them all in sequence in a single transaction, so a failure will roll back the entire batch. This should work now with changes I put into CVS. There are changes in the following files:
M src/net/sourceforge/sqlunit/IErrorCodes.java
M src/net/sourceforge/sqlunit/IncludeHandler.java
M src/net/sourceforge/sqlunit/TeardownHandler.java
A test/sybase/teardown.sql
M test/sybase/test.xml
I think I will make a release pretty soon, so if you want you can wait for a full release, but meanwhile the code is in cvs.
-sujit
Now it's not throwing any error.But only the 1st statement gets executed.
For eg. If there are 2 delete statements are there then only 1st delete statement hget executed.But both delete statement is proper.
Please just check this and provide a solution.
My apologies, its fixed now in CVS. The only change is in the IncludeHandler.java code. I am trying to fold in some Oracle stuff for the next release, will probably release end of this week, so if you need this sooner, please get the CVS version.
Thanks for catching this.
-sujit
I downloaded IncludeHandler.java and checked but still it's not working
Thanks
-sowmya
Can you provide more details? Is it still the first SQL statement that gets executed? Does it throw any errors? At the risk of asking a real stupid question, did you recompile the code with ant install and move the sqlunit*.jar file to your classpath (ie where the old one was)? I am sure you must have done it, just trying to make sure.
Thanks
Sujit
No. It's not throwing any error.
Only 1st SQL statement is getting executed.I have put SQLUnit*.jar file to my classpath.
Thanks
Sowmya
Just now I downloaded 2.4V in that teardown is working fine.
Thanks a lot
sowmya
Good. Glad it worked :-).
-sujit