Tibco EMS instance dies with Hibernate exception

If your Tibco EMS instance dies, and the last thing in the log looks like this:

ERROR: Failed to refresh lock for store '$sys.meta', [ERRSTR = org.hibernate.exception.JDBCConnectionException: 
could not load an entity: [com.tibco.tibems.tibemsd.internal.db.HBLock#1] ]

it’s probably due to connectivity problems with the DB. As this thread states: if the connection is lost, the service shuts down without trying to reconnect. Sadly it doesn’t bother to log the fact that it’s shutting down.

There’s also a DBSTORE logging option, that may provide some further detail if enabled (we’ll see!).

Load testing Tibco EMS with JMeter

The JMeter documentation does an excellent job of describing how to set up a test plan for a JMS provider. However there are still a few provider specific details you need to know:

Make sure you’ve copied all the jars from TIBCO_HOME\ems\6.0\lib to jmeter\lib!

The InitialContextFactory for TIBCO EMS 6.0 is:

com.tibco.tibjms.naming.TibjmsInitialContextFactory

A fault tolerant Provider Url looks like:

tibjmsnaming://machine1:7222,tibjmsnaming://machine2:7222

It’s also worth setting the reconnect_attempt_delay (or count) reasonably high in your connection factory, as it can take a while for failover to succeed.

[LoadTesting]
  type                     = topic
  url                      = tcp://machine1:7222,tcp://machine2:7222
  reconnect_attempt_delay  = 10000

If you’re using durable subscribers, you can only have one thread (user) per subscriber as the client id must be unique. And the permissions are different (durable & use_durable).

You can’t use MapMessage, stick with TextMessage.

There’s a bug in JMeter 2.5.1 (fixed in the trunk) that may cause you to see NPEs when getting the connection (InitialContextFactory.lookupContext doesn’t use the map/cache properly).