OpenMRS recently added a non-null uuid column to every table.  All of our dbunit xml files needed to be updated to insert values for this attribute.  I wrote the following shell script to loop over all xml files under the current folder and add a uuid attribute to all rows that didn’t have an attribute already.  There is a bit of logic in there to ignore certain tables because those tables didn’t actually get any uuids.

…read the rest of this entry »

This is in the openmrs category tagged as , , ,

Add a comment »

One of MySQL’s biggest annoyances is the lack of descriptive error messages. Often when dropping a table, index, foreign key you get a cryptic “errno 150 or errno152″ error message.

Well, now when you come across those simply go to the command line and type:

show engine innodb status;

Scroll up a ways and see a very helpful message about exactly which other foreign key or index is causing the blockage! Why can’t MySQL put this information into error message to begin with??

This is in the openmrs category tagged as

Add a comment »

- 12 Apr 2009 -

Darius recently removed the patient set portlet that was unused in the default header. If you have a custom template/headerFull.jsp you will need to remove the content of the “popupTray” element. This effects versions 1.5.0 dev Build 7290. The full changeset.

If you don’t remove that, the error message you get is something like this:

The following error happened somewhere on this page: javax.servlet.jsp.JspException: You must specify a fromAttribute when using the patientSet portlet

This is in the openmrs category tagged as

Add a comment »

- 11 Apr 2009 -

In December Meghan and I visited my sister and her husband (Katie and Patrick Portner). Patrick has a friend that owns a Ferrari 360 Modena that he was lucky enough to borrow for the weekend. Patrick and I drove it on a nearby expressway. My limit was around 130 mph. The car was amazing though, it was hugging the road and zipping nicely no matter what speed I was going. :-)

This is in the babble category tagged as ,

Add a comment »

Currently tables created in MySQL default to MyISam. This is unacceptable for us at Openmrs. You can set a property in your my.cnf file called “default-storage-engine”, but I needed a solution that didn’t involve implementers having to modify their system config files.

I changed the jdbc connection url string to set a session property that sets InnoDB as the default engine:

jdbc:mysql://localhost:3306/databasename?autoReconnect=true&sessionVariables=storage_engine=InnoDB

NOTE! Requires mysql jdbc connecter version 3.1.18 or greater. See http://dev.mysql.com/doc/refman/5.0/en/connector-j.html for documentation and then http://dev.mysql.com/downloads/connector/j/ to download.

The error message I was getting before upgrading the mysql jdbc connector was:

java.sql.SQLException: Server connection failure during transaction. Due to underlying exception: ‘java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1′.

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1

STACKTRACE:

java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:929)
at com.mysql.jdbc.Connection.setSessionVariables(Connection.java:5077)
at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3680)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2684)
at com.mysql.jdbc.Connection.<init>(Connection.java:1474)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

This is in the babble category tagged as ,

Add a comment »

« Previous Entries Next Entries »