Posts Tagged ‘apache’

How to get information on UNIQUE keys on Apache Derby

Tuesday, October 16th, 2007

It´s not easy to get information on derby keys once you created them. I was looking for a command like “SHOW CREATE TABLE <tablename>” but no luck. I realized that the answer should lay in SYS tables. After googling a while I found the following bit of wisdom:

The following query will give you the UNIQUE constraints on a table:

select c.constraintname, c.constraintid
from sys.systables t, sys.sysconstraints c
where t.tablename = 'FOO'
and t.tableid = c.tableid
and c.type = 'U'
;

The following query will return a descriptor object for each constraint
on the table.  The descriptor will tell you which columns are in each
constraint. As noted in the Reference Guide section on
SYS.SYSCONGLOMERATES, the descriptor object implements
org.apache.derby.catalog.IndexDescriptor. Please note that the
descriptor object is not part of Derby' public API and can therefore
change from release to release:

select g.descriptor
from sys.systables t, sys.sysconstraints c, sys.syskeys k,
sys.sysconglomerates g
where t.tablename = 'FOO'
and t.tableid = c.tableid
and c.type = 'U'
and c.constraintid = k.constraintid
and k.conglomerateid = g.conglomerateid
;

Silly Apache JMeter 2.2 bug

Wednesday, April 25th, 2007

The JDBC Sampler always commits (it doesn’t honor the auto-commit = false parameter)

http://issues.apache.org/bugzilla/show_bug.cgi?id=42018. I’ve provided a patch that solved it at Bugzilla

Source code for Statistical Visualizer plugin for Apache Jmeter 2.2

Wednesday, January 17th, 2007

I just released the source code for the other Apache Jmeter plugin that I host here. Just go to the end of this page to download the file and get instructions.

Source code for enhanced jdbc sampler released

Wednesday, January 17th, 2007

I released the Enhanced JDBC Sampler for Apache JMeter 2.2 source code today. See the bottom of this page to find the downloadable zip and instructions.

Enhanced JDBC Sampler for Apache JMeter

Thursday, December 14th, 2006

I’ve moved this post to the following page.

UPDATE: The files here will only run in JRE 1.6. I will try to provide JRE 1.5-compatible files as soon as possible. Thanks to Daniel for pointing this out.

Some time ago I posted a bug report for Apache JMeter benchmarking utility (you can find my other jmeter bug reports here) . The bug report contains an enhancement of the current JDBC Sampler to allow JMeter to invoke PreparedStatements and also to change the way Callable Statements are handled to avoid performance problems when using some JDBC drivers (mainly Sybase).

Because I don’t know if this bug report will ever be integrated in JMeter or when. I decided to release this “Enhanced JDBC Sampler” as a JMeter plugin. The installation is quite simple just unzip the EnhancedJdbcSampler.zip and put the EnhancedJdbcSampler.jar file in the $JMETER_HOME/lib/ext directory.

Once you restart JMeter you should see a new option under Add -> Samplers called “Enhanced JDBC Request”. It works just like the old JDBC Sampler (see docs on how to use JDBC sampler here and here).

The difference with the conventional JDBC Sampler is that you now have more options under Query type and there are two new text boxes at the bottom of the page. In the first box, you write the param values, and in the second box you write the param types. See the image below for an example.

Enhanced JDBC Sampler Screenshoot

In this example there are two parameters: the literal 1 and the variable ${A}. (In this particular case the ${A} comes from a Counter). The type of both parameters is INT. Check the list of JDBC Types.

Better JMeter Graphs

Tuesday, December 12th, 2006

I’ve moved this post to the following location

**UPDATE**: The files here will only run in JRE 1.6. I will try to provide JRE 1.5-compatible files as soon as possible. Thanks to Daniel for pointing this out.

If you are tired of the old “Graph Results” listener that JMeter provides

Old Graph Results

Click on the above image or here to see an enlarged version

Checkout this new JMeter plugin that provides a new Statistical Aggregate Report

Statistical Aggregate Report

Click on the above image or here to see an enlarged version

Installation

To install the plugin you only have to unzip the zipfile into the JMeter 2.2.1 installation dir. The zip file has four files, three of them go into the $JMETER_HOME/lib directory and the other file goes into the $JMETER_HOME/lib/ext directory.

Once is installed, restart JMeter and now you must see a new “Statistical Aggregate Report” in the Add -> Listener menu.

This plugin it’s mainly the work of Lars Krogjensen (he provided most of the code) I only modified it a bit and repackaged it. I’ll post the source code as soon as I can.

Hope you find it useful

Apache JMeter bugs

Sunday, October 29th, 2006

I’ve been working with Apache JMeter 2.2 mainly for JDBC benchmarks and I found a couple of bugs.