Calling stored procedures from Mirth

Posted in Computación with tags , , , , , , on 27/October/2010 by Alex Pérez

Mirth JDBC reader/writer are well suited for simplest cases: only one SELECT and (optionally) a UPDATE for each row, but normally you need to use JDBC reader/writer with JS enabled.

Mirth JDBC API when using JS is very basic and does not allow easily deal with stored procedures: there are only executeCachedQuery() and executeUpdate(). If you’re lucky you can use executeUpdate() as long as your SP doesn’t use IN/OUT parameters or returns any resultset. Otherwise you should call the SPs in a java library and then invoke it from Mirth JS. Some time ago I documented how to call custom java classes from Mirth and this may be used to extend its database API. Read more »

Shared SCSI Storage with VMWare Server 2.0 and OCFS

Posted in Computación with tags , , , , , , , on 19/October/2010 by Alex Pérez

(An update over the same trick with VMWare Server 1.X)

VMWare Server was declared End Of Availability on Jan/2010, while VMWare is pushing to use Player, ESX(i), vCenter, vSphere and all the “formerly known as” product names. I think that VMWare Server series are a great software, but v2.0 was sentenced to death since:

The King is dead. Long live the King.

Well, let’s see a recipe for configuring a shared SCSI bus + OCFS2 with VMWare Server 2.0.

I will use a turnkey Linux appliance in this test, because it has a very simple startup menu for configuring IP address and it’s debian based (apt-get!). Read more »

SOAP polling with Mirth

Posted in Computación with tags , , , , , , on 10/October/2010 by Alex Pérez

There are some recurrent problems when developing interfaces with Mirth, and one of the trickiest is SOAP polling. From early versions of Mirth there is a SOAP sender connector, but it doesn’t have any direct connector to poll a webservice. As far as I know polling is considered to be a near-antipattern, but under some circunstances you may be forced to use it if the integration counter-part is closed-source.

To read periodically from a WS you need to setup an interface with these connectors:

  • source: JS Reader
  • destination 1: SOAP Sender
  • postprocessor or destination 2: JS Writer (or any other destination-type with a JS Transformer inside) Read more »

Indexing NULL column values

Posted in Computación with tags , , , , , , , , on 1/August/2010 by Alex Pérez

After reading some great articles from Burleson Consulting about the “is null/is not null” predicates I decided to make some additional tests. It’s a very common mistake to write SQL with this kind of predicates since the NULL values aren’t included in regular indexes (B*Tree, not function-based), so almost every “IS NULL” results in a TABLE FULL SCAN.

I want to test how much a index can improve a IS [NOT] NULL predicate measuring the #requests per minute that a legacy box can serve. In the old days this server was a mission-critical server, but nowadays is retired as test server and can be compared to a very low end box (P3-512M ram).
Well, I measure the time that the select statement takes to execute (using JMeter)  instead of cost because a 30% reduction cost does not mean a 30% time reduction, and usually the end-user speak in terms of time, and there are many “tricks” like moving a table to the KEEP_POOL that can speed-up SQL execution although the cost is the same.
Read more »

Using JMeter to test JDBC databases

Posted in Computación with tags , , , , , , , on 17/April/2010 by Alex Pérez

Despite JMeter is a well-known load testing tool when testing web projects, it seems to be unused when testing SQL performance. So I decided to share how to configure a fairly simple SQL test plan involving only one SQL statement.

Download Apache JMeter and Java, if you don’t have them already.

Get a copy of the oracle driver (ojdbc14.jar) or a JDBC driver of your preferred DB, and throw it into the JMETER_HOME/lib directory

  • Open JMeter and create a test plan as shown in fig1. Based on this plan you can complicate it as you want to load your DB and fit it to your needs. There are two JMeter Listeners (red) called “Aggregate Report” and “Summary Report” that will report us some statistical results like mean, median, throughput among others. I recommend you to use the Statistical Aggregate Report listener. Inside the thread group (blue) are two items of type “JDBC Connection Configuration” and “JDBC Request”. As we will see, is where we define the DB connection properties (user, password, driver, IP, SID), and the statement we want to test. Read more »

Installing oracle instant client on Linux

Posted in Computación with tags , , , , , , , on 20/July/2009 by Alex Pérez

This is a miniguide to install sqlplus with the minimal oracle-software fingerprint. As far as I can, I avoid to install the Oracle Client in my computers, because in MS Windows it modifies heavily the registry, and in linux you should set a lot of environment variables and deal with Oracle Universal Installer (OUI) that depends on many packages, versions, java … etc. And there is a better solution to install a simple sqlplus without installing the whole Oracle Client: oracle instant client.

I’ve used the 10.2.0.4 version, but I suppose that using any other 10.X or even 11.X version should be similar. Read more »

tcpdump – Packet size limited during capture [ENG]

Posted in Computación with tags , , , , , , on 16/July/2009 by Alex Pérez
Wireshark logo

Wireshark logo

[Due to the # of hits of this entry, I translated this to English .... my poor English xD]

I was looking why a web application was not running at all. The browser must send a request and the app should add some headers in order to login without problems … but seeing that the web application didn’t behave as expected, I decided to see what’s going on and what was sending *exactly* the browser to the app.

So, I left a “tcpdump” running in the server, and replayed the issue with the browser. When I opened the dump file with Wireshark (Ethereal fork, AFAIK), I found that too many frames got a tag “Packet size limited during capture”.

WTF?

After searching with Wireshark some strings that are supposed to exist in the HTTP request ….no luck. But I’m 100% sure that the browser is sending the string I’m searching!?

Wireshark - Packet size limited during capture

Wireshark - Packet size limited during capture

No luck. And … what’s this message “Packet size limited during capture”?

After googling for a while, it seems that older versions of tcpdump, or running tcpdump in old OSes, by default the packet size it’s truncated to 96 or 68 bytes. So, the Wireshark/Ethereal option “Follow TCP Stream” is unable to show what’s exactly going on between the broswser and HTTP server.

If we want to capture network frames full-length, you must use “-s 0″ flag. (ie # tcpdump -i eth0 -w file.cap -s 0). But in tcpdump manpage they alert that this is a lot of extra work to the server. With the “-s 0″ flag, the frames are captured with the original length, and we can follow the TCP stream as required.

HTH

Plata coloidal casera

Posted in No Computación with tags , , , , , , on 3/July/2009 by Alex Pérez

Desde hace algunos meses estoy asistiendo a lo que parece un resurgimiento de las terapias alternativas/ocultismo/paraciencias en algunos blogs que frecuento. He alucinado bastante con algunos posts acerca de:

  • chemtrails/orgonita
  • campañas anti-vacunación
  • radiestesia, astrología … etc

Sería un error pensar que esto son creencias marginales y restarle importancia al asunto. Al contrario: hace unos meses me sorprendí discutiendo con una amiga acerca de la existencia de los chemtrails. No es un problema de formación, puesto que ella es ingeniera (si, ya sé que no es garantía de nada, pero tiene un nivel alto de formación), sino que más bien lo veo como una total falta de pensamiento crítico. Y -cómo no- su discurso era bastante conspiranoico: en cuanto le respondía que algun punto de teoría hacía aguas siempre aducía la existencia de grupos de control/farmacéuticas … que se estaban encargando de que la opinión pública ignorara semejante proyecto. El colmo es el asunto de la orgonita, en el cual un compuesto de resina-cuarzo-metal se supone que emite un tipo de radiación (por supuesto: no medible, ni detectable, ni tiene efectos observables) que neutraliza la acción de los chemtrails. Como todos sabemos uno de los efectos de los chemtrails es la modificación del clima.
Con los chemtrails, alguien que sigue pensamientos mágicos para esto lo tiene fácil:

  • si no llueve, es por los chemtrails
  • si llueve, es por la acción de la orgonita que está neutralizando los chemtrails
  • si llueve demasiado, es por los chemtrails… (nunca llueve a gusto de todos, está claro xD)
  • si querías ir a la playa y llueve, es por los chemtrails
  • si hace unas semanas que no llueve, es por los chemtrails

Read more »

unos (tristes?) chistes

Posted in No Computación with tags on 26/April/2009 by Alex Pérez
  • ¿Por qué los informáticos confunden Halloween con Navidad? Pues porque 31(oct) = 25(dec)
  • ”μ”, dijo la vaca científica
  • “Un homeópata dejó de tomar su medicamento y murió de sobredosis”. (ver Ley de infinitesimales)

The UNIX haters handbook

Posted in Computación with tags , , , , , on 25/April/2009 by Alex Pérez

Buscando por ahi (no recuerdo las fuentes) he encontrado esta pedazo de joya de libro.

Sí! ya sé que está mal visto hablar mal de Linux/Unix o hablar bien de windows. Pero como ya no tenemos 15 años y tengo el vicio de leer cosas con las que no estoy de acuerdo, pues lo voy a poner igual.

El libro: The Unix Haters, del 1994. Aprovechando que últimamente estoy revisando algunos de los libros más viejos que tengo, este me ha llamado particularmente la atención. Básicamente son historias dignas del peor BOFHer, acerca de “cagadas de administrador” recopiladas a través de listas de correo/grupos de news.

Quitando el tema de que está escrito en un tono panfletario y jocoso, hay que reconocer que lo que se comenta tiene un punto de certeza. También si evitamos el tópico de que todo lo que viene de Microsoft es malo y todo lo que es GPL es bueno -nunca me gustó simplificar tanto- se puede realmente avanzar en algo. El tópico de que un administrador experimentado al que se le cuelga la instalación de SQL Server seguramente dirá: “j*** microsoft”, hará unos chistecitos acerca de algun familiar de Bill Gates … etc. Pero a un administrador experimentado en linux, no se le ocurre decir “j*** linux”. En este segundo caso, el reflejo es autoculparse; mientras que si el problema es en windows aunque la cagada sea de uno mismo, el reflejo es culpar a MS.

Y aquí va el libro en PDF:

http://www.simson.net/ref/ugh.pdf

PD: abstenerse de leer si no se tiene un mínimo de sentido del humor/autocrítica.

Follow

Get every new post delivered to your Inbox.