<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to data-generator</title><link>https://sourceforge.net/p/db2mc/data-generator/</link><description>Recent changes to data-generator</description><atom:link href="https://sourceforge.net/p/db2mc/data-generator/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 16 Nov 2011 05:30:09 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/db2mc/data-generator/feed.rss" rel="self" type="application/rss+xml"/><item><title>IntegerGenerator incorrectly calculates the values available</title><link>https://sourceforge.net/p/db2mc/data-generator/21/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In the validateRanges() method in IntegerGenerator, part of the method checks to see if there are enough values it is able to produce given the range, interval and whether looping is allowed. I.e. for a range of [-2, 2] and interval of 1, there are 5 unique values it is able to produce (-2, -1, 0, 1, 2) which, if looping is not allowed, means the most values(rows) it can produce is 5.&lt;br /&gt;
The method incorrectly adds 1 to the range (i.e. endRange-startRange) which when given an interval of 1, it incorrectly reports the number of values it can produce to be greater (by 1) than what it should&lt;/p&gt;
&lt;p&gt;To test this I modified a the test case testIntegerSeqNoLoopBackwards() in IntegerGeneratorTest and set the values to produce when instantiating the IntegerGenerator to be 4 (it was set to 5 because it is using a range of [-2, 2]). This should have caused the test to fail when running ant clean test but instead it still passed&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Wed, 16 Nov 2011 05:30:09 -0000</pubDate><guid>https://sourceforge.nete5d757753873dc074319667afcc43ef12dff6179</guid></item><item><title>IntegerGeneratorTest overflows values passed to methods</title><link>https://sourceforge.net/p/db2mc/data-generator/20/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In some of the test cases, methods are called that will take Integers as arguments but will be passed the value Integer.MAX_VALUE * 2 which is an integer overflow. Since these methods aren't being tested for overflow handling, it is unnecessary.&lt;/p&gt;
&lt;p&gt;i.e. in test case testAllDefault()&lt;br /&gt;
gen.advance(0, Integer.MAX_VALUE * 2);&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Tue, 25 Oct 2011 03:11:30 -0000</pubDate><guid>https://sourceforge.net031f5740d7c294af99af476b507e875ff9e338f0</guid></item><item><title>DG breaks the primaray key constraint for random generation</title><link>https://sourceforge.net/p/db2mc/data-generator/19/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Tested in IntegerGenerator.java&lt;br /&gt;
When you specify DG to generate random values for a field that is also a primary key, DG will not produce unique values to be inserted and causes the commit batch to fail. It is not documented whether random generation on primary key fields should be allowed or not. If it shouldn't be allowed, DG should print an error message when parsing and shut down gracefully.&lt;/p&gt;
&lt;p&gt;Example table:&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;attr name="name" value="inter.test"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="row_count" value="100"/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;fields&amp;gt;&lt;br /&gt;
&amp;lt;field&amp;gt;&lt;br /&gt;
&amp;lt;attr name="name" value="neg"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="type" value="INTEGER"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="constraint" value="NOT NULL"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="pkey" value="true"/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;data&amp;gt;&lt;br /&gt;
&amp;lt;attr name="type" value="integer"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="seq"  value="false"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="loop" value="true"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="start_range" value="0"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="end_range" value="200"/&amp;gt;&lt;br /&gt;
&amp;lt;/data&amp;gt;              &lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt; &lt;/p&gt;
&lt;p&gt;Output:&lt;br /&gt;
2076 [main] INFO com.ibm.dg.DataGenerator  - Generating data for 'inter.test' table.&lt;br /&gt;
This table will have 100 row(s).&lt;br /&gt;
Threads: 4, with around 25 row(s) per thread.&lt;br /&gt;
Exception in thread "Thread-2" java.lang.RuntimeException: Thread failed to execute batch, stopping: SQLException 0&lt;br /&gt;
Code: -4229&lt;br /&gt;
SqlState: null&lt;br /&gt;
Error Message: [jcc][t4][102][10040][3.62.56] Batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch.&lt;br /&gt;
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null&lt;br /&gt;
SQLException 1&lt;br /&gt;
Code: -803&lt;br /&gt;
SqlState: 23505&lt;br /&gt;
Error Message: Error for batch element #10: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;INTER.TEST, DRIVER=3.62.56&lt;br /&gt;
SQLException 2&lt;br /&gt;
Code: -803&lt;br /&gt;
SqlState: 23505&lt;br /&gt;
Error Message: Error for batch element #17: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;INTER.TEST, DRIVER=3.62.56&lt;/p&gt;
&lt;p&gt;at com.ibm.dg.threads.TableThread.commitBatch(TableThread.java:331)&lt;br /&gt;
at com.ibm.dg.threads.TableThread.run(TableThread.java:251)&lt;br /&gt;
at java.lang.Thread.run(Thread.java:636)&lt;br /&gt;
Exception in thread "Thread-3" java.lang.RuntimeException: Thread failed to execute batch, stopping: SQLException 0&lt;br /&gt;
Code: -4229&lt;br /&gt;
SqlState: null&lt;br /&gt;
Error Message: [jcc][t4][102][10040][3.62.56] Batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch.&lt;br /&gt;
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null&lt;br /&gt;
SQLException 1&lt;br /&gt;
Code: -803&lt;br /&gt;
SqlState: 23505&lt;br /&gt;
Error Message: Error for batch element #1: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;INTER.TEST, DRIVER=3.62.56&lt;/p&gt;
&lt;p&gt;at com.ibm.dg.threads.TableThread.commitBatch(TableThread.java:331)&lt;br /&gt;
at com.ibm.dg.threads.TableThread.run(TableThread.java:251)&lt;br /&gt;
at java.lang.Thread.run(Thread.java:636)&lt;br /&gt;
Comm. (stmts) Comm. (size)  Commit Rate (stmts/s) Commit Rate (size/s)&lt;br /&gt;
======&lt;br /&gt;
1          4.0 B                       -1                   null&lt;br /&gt;
1          4.0 B                       -1                   null&lt;br /&gt;
1          4.0 B                       -1                   null&lt;br /&gt;
1          4.0 B                       -1                   null&lt;br /&gt;
1          4.0 B                       -1                   null&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Sun, 16 Oct 2011 18:56:39 -0000</pubDate><guid>https://sourceforge.net9450432d8db70ac12649caaa7c28f8339f13c63f</guid></item><item><title>[junit] Testcase: testIntegerSeqLoopTwo took 0.008 sec</title><link>https://sourceforge.net/p/db2mc/data-generator/18/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;One of the test cases is failing for the Integer data generator -- the specific interval is [-2..5] where the proper sequence does not get generated. Integer generator logic needs some patching:&lt;/p&gt;
&lt;p&gt;[junit] Testcase: testIntegerSeqLoopTwo took 0.008 sec&lt;br /&gt;
[junit]   FAILED&lt;br /&gt;
[junit] Sequential generator returned wrong value. expected:&amp;lt;-[4]&amp;gt; but was:&amp;lt;-[5]&amp;gt;&lt;br /&gt;
[junit] junit.framework.ComparisonFailure: Sequential generator returned wrong value. expected:&amp;lt;-[4]&amp;gt; but was:&amp;lt;-[5]&amp;gt;&lt;br /&gt;
[junit]   at com.ibm.dg.generators.IntegerGeneratorTest.testIntegerSeqLoopTwo(IntegerGeneratorTest.java:197)&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikita </dc:creator><pubDate>Sun, 09 Oct 2011 00:55:59 -0000</pubDate><guid>https://sourceforge.net5c5a17c4f9e108b476a5c79af6e53d044cd5a187</guid></item><item><title>Statistics do not print properly when run w/ multple threads</title><link>https://sourceforge.net/p/db2mc/data-generator/17/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Tested with datasource_threads and generator_threads configured with 1 and 4 threads in config.xml and received similar output:&lt;br /&gt;
6605 [main] INFO com.ibm.dg.DataGenerator  - Generating data for 'Movie.Address' table.&lt;br /&gt;
This table will have 10000 row(s).&lt;br /&gt;
Threads: 4, with around 2500 row(s) per thread.&lt;br /&gt;
Comm. (stmts) Comm. (size)  Commit Rate (stmts/s) Commit Rate (size/s)&lt;br /&gt;
======&lt;br /&gt;
10,000      450.3 KB                    5,000               225.2 KB&lt;br /&gt;
10,000      450.3 KB                    5,000               225.2 KB&lt;br /&gt;
16916 [main] INFO com.ibm.dg.DataGenerator  - Generating data for 'Movie.Address' table completed in: 00:00:10&lt;/p&gt;
&lt;p&gt;ran with -q switch&lt;br /&gt;
db2inst1@ubuntu-school:~/DG-test/DG/dist$ java -jar DG.jar -q 1 -d ./data/schemas/movie-merged.xml&lt;/p&gt;
&lt;p&gt;6802 [main] INFO com.ibm.dg.DataGenerator  - Generating data for 'Movie.Address' table.&lt;br /&gt;
This table will have 10000 row(s).&lt;br /&gt;
Threads: 1, with around 10000 row(s) per thread.&lt;br /&gt;
Comm. (stmts) Comm. (size)  Commit Rate (stmts/s) Commit Rate (size/s)&lt;br /&gt;
======&lt;br /&gt;
400      18.0 KB                       80                 3.6 KB&lt;br /&gt;
809      36.4 KB                       80                 3.6 KB&lt;br /&gt;
1,212        54.6 KB                       80                 3.6 KB&lt;br /&gt;
1,611        72.5 KB                       80                 3.6 KB&lt;br /&gt;
2,004        90.2 KB                       80                 3.6 KB&lt;br /&gt;
2,394       107.7 KB                       79                 3.6 KB&lt;br /&gt;
2,797       125.9 KB                       79                 3.6 KB&lt;br /&gt;
3,205       144.3 KB                       80                 3.6 KB&lt;br /&gt;
3,610       162.5 KB                       80                 3.6 KB&lt;br /&gt;
4,016       180.8 KB                       80                 3.6 KB&lt;/p&gt;
&lt;h1 id="comm-40stmts41-comm-40size41-commit-rate-40stmtss41-commit-rate-40sizes41"&gt;Comm. (stmts) Comm. (size)  Commit Rate (stmts/s) Commit Rate (size/s)&lt;/h1&gt;
&lt;p&gt;4,424       199.2 KB                       80                 3.6 KB&lt;br /&gt;
4,830       217.5 KB                       80                 3.6 KB&lt;br /&gt;
5,235       235.8 KB                       80                 3.6 KB&lt;br /&gt;
5,646       254.2 KB                       80                 3.6 KB&lt;br /&gt;
6,051       272.4 KB                       80                 3.6 KB&lt;br /&gt;
6,455       290.7 KB                       80                 3.6 KB&lt;br /&gt;
6,863       309.0 KB                       80                 3.6 KB&lt;br /&gt;
7,271       327.4 KB                       80                 3.6 KB&lt;br /&gt;
7,631       343.6 KB                       80                 3.6 KB&lt;br /&gt;
8,039       361.9 KB                       80                 3.6 KB&lt;/p&gt;
&lt;h1 id="comm-40stmts41-comm-40size41-commit-rate-40stmtss41-commit-rate-40sizes41_1"&gt;Comm. (stmts) Comm. (size)  Commit Rate (stmts/s) Commit Rate (size/s)&lt;/h1&gt;
&lt;p&gt;8,449       380.4 KB                       80                 3.6 KB&lt;br /&gt;
8,857       398.7 KB                       80                 3.6 KB&lt;br /&gt;
9,265       417.2 KB                       80                 3.6 KB&lt;br /&gt;
9,665       435.2 KB                       80                 3.6 KB&lt;br /&gt;
10,000      450.3 KB                       80                 3.6 KB&lt;br /&gt;
10,000      450.3 KB                       80                 3.6 KB&lt;br /&gt;
137059 [main] INFO com.ibm.dg.DataGenerator  - Generating data for 'Movie.Address' table completed in: 00:02:10&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Sat, 08 Oct 2011 15:44:22 -0000</pubDate><guid>https://sourceforge.nete08b8bba8df2f25b8dec4bc770af312544f6725f</guid></item><item><title>DG goes into infinite loop. Sometimes throwing an exception</title><link>https://sourceforge.net/p/db2mc/data-generator/16/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;When DG is running on the attached schema XML file, when generating the movie.movie_info table it will go into an infinite loop. Sometimes it throws an exception but I have been unable to reproduce it again. Most of the time it doesn't display any errors at all.&lt;/p&gt;
&lt;p&gt;If I get it to throw an exception I will post that as well.&lt;/p&gt;
&lt;p&gt;121338 [main] INFO com.ibm.dg.DataGenerator  - Generating data for 'movie.movie_info' table.&lt;br /&gt;
This table will have 1000 row(s).&lt;br /&gt;
Threads: 4, with around 250 row(s) per thread.&lt;br /&gt;
Comm. (stmts) Comm. (size)  Commit Rate (stmts/s) Commit Rate (size/s)&lt;br /&gt;
======&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
4        531.0 B                       -1                   null&lt;br /&gt;
^C166354 [Thread-0] WARN com.ibm.dg.DataGenerator  - Shutting down.&lt;/p&gt;
&lt;p&gt;While this was running I checked how many records were actually in the table and it was only 4, no matter how long DG was running for.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Sat, 08 Oct 2011 13:37:40 -0000</pubDate><guid>https://sourceforge.net88d85a93869cfecafa5db57be1da27d24227972c</guid></item><item><title>DG goes into an infinite loop when a commit batch fails</title><link>https://sourceforge.net/p/db2mc/data-generator/15/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The batch of commit statements failed because:&lt;br /&gt;
AN INSERTED OR UPDATED VALUE IS INVALID BECAUSE THE INDEX IN INDEX SPACE indexspace-name CONSTRAINS COLUMNS OF THE TABLE SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS. RID OF EXISTING ROW IS X record-id&lt;/p&gt;
&lt;p&gt;DG continued to run and looked like it was still committing rows. Difficult to catch since if a user walks away from their computer while DG is running, they won't see the error message printed.&lt;/p&gt;
&lt;p&gt;63996 [main] INFO com.ibm.dg.DataGenerator  - Generating data for 'Movie.people_relationship' table.&lt;br /&gt;
This table will have 1000 row(s).&lt;br /&gt;
Threads: 4, with around 250 row(s) per thread.&lt;br /&gt;
Exception in thread "Thread-24" java.lang.RuntimeException: Thread failed to execute batch, stopping: SQLException 0&lt;br /&gt;
Code: -4229&lt;br /&gt;
SqlState: null&lt;br /&gt;
Error Message: [jcc][t4][102][10040][3.62.56] Batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch.&lt;br /&gt;
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null&lt;br /&gt;
SQLException 1&lt;br /&gt;
Code: -803&lt;br /&gt;
SqlState: 23505&lt;br /&gt;
Error Message: Error for batch element #1: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;MOVIE.PEOPLE_RELATIONSHIP, DRIVER=3.62.56&lt;/p&gt;
&lt;p&gt;at com.ibm.dg.threads.TableThread.commitBatch(TableThread.java:331)&lt;br /&gt;
at com.ibm.dg.threads.TableThread.run(TableThread.java:251)&lt;br /&gt;
at java.lang.Thread.run(Thread.java:636)&lt;br /&gt;
Comm. (stmts) Comm. (size)  Commit Rate (stmts/s) Commit Rate (size/s)&lt;br /&gt;
======&lt;br /&gt;
250       2.9 KB                       -1                   null&lt;br /&gt;
250       2.9 KB                       -1                   null&lt;br /&gt;
250       2.9 KB                       -1                   null&lt;br /&gt;
250       2.9 KB                       -1                   null&lt;br /&gt;
250       2.9 KB                       -1                   null&lt;br /&gt;
250       2.9 KB                       -1                   null&lt;br /&gt;
250       2.9 KB                       -1                   null&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Sat, 08 Oct 2011 10:35:51 -0000</pubDate><guid>https://sourceforge.net22deb51d5961190f136bcceaf933d148e10a1e15</guid></item><item><title>Exception when end_range is specified but start_range is not</title><link>https://sourceforge.net/p/db2mc/data-generator/14/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;When specifying the attribute end_range for an integer generator, if start_range is missing then DG throws a NullPointerException. If this is expected behaviour (i.e. start_range and end_range must be specified together) then it should be noted in the documentation since it lists both of these fields as optional. Although the documentation says that if the start_range isn't specified it will be set as default to 1, so start_range shouldn't be required in order to use end_range based on this.&lt;/p&gt;
&lt;p&gt;This will cause DG to throw the exception if it's in the xml:&lt;br /&gt;
&amp;lt;field&amp;gt;&lt;br /&gt;
&amp;lt;attr name="name" value="director_id"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="type" value="INTEGER"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="constraint" value="NOT NULL"/&amp;gt;&lt;br /&gt;
&amp;lt;data&amp;gt;&lt;br /&gt;
&amp;lt;attr name="type" value="integer"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="seq" value="false"/&amp;gt;&lt;br /&gt;
&amp;lt;attr name="end_range" value="7000"/&amp;gt;&lt;br /&gt;
&amp;lt;/data&amp;gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Sat, 08 Oct 2011 02:59:02 -0000</pubDate><guid>https://sourceforge.net9b5f3bd39e2746d029140fc64fb100c6143ce6a1</guid></item><item><title>Set custom table dependancies</title><link>https://sourceforge.net/p/db2mc/data-generator/13/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;It would be nice to have an option for tables to be able to specify dependencies of other tables to have better control of the order of creation of the tables. In the case where you use a SQL generator, if the SQL is pulling values from a table that DG is being created then that table will need to be created first&lt;br /&gt;
something like &amp;lt;attr name="depends" value="x,y,x"&amp;gt; under the &amp;lt;options&amp;gt; element&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Fri, 07 Oct 2011 23:40:44 -0000</pubDate><guid>https://sourceforge.netb7dc1ed77091ef3e6fdd6a595484c0e258ccc366</guid></item><item><title>Bad example of an SQL generator in the manual</title><link>https://sourceforge.net/p/db2mc/data-generator/12/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;This example is given in the documentation as an example of a slow generator. This particular SQL will continuously pull the same name to use as a value to insert, while it should probably pull a random value from the table instead&lt;br /&gt;
&amp;lt;!-- For each row generated this field will get a name from the names table.&lt;br /&gt;
This generator will be slow - names are selected one at a time. --&amp;gt;&lt;br /&gt;
&amp;lt;field name= "name" type= "VARCHAR(128)" &amp;gt;&lt;br /&gt;
&amp;lt;data type= "SQL" &amp;gt;&lt;br /&gt;
&amp;lt;attr name= "sql" &amp;gt;&lt;br /&gt;
SELECT name FROM db2inst1.names FETCH FIRST 1 ROW ONLY&lt;br /&gt;
&amp;lt;/attr&amp;gt;&lt;br /&gt;
&amp;lt;/data&amp;gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael</dc:creator><pubDate>Fri, 07 Oct 2011 23:27:09 -0000</pubDate><guid>https://sourceforge.net04606ce078dedbb85f7c583a2136845e1c7c3be4</guid></item></channel></rss>