Published: February, 15th 2008 HiveMind Utilities
General utility modules for HiveMind
SourceForge.net Logo

Frequently Asked Questions

Why this name?

You may wonder why this project was originally named "HiveTranse".

Actually, I am ashamed of it, this was first an English mistake of mine!

Originally, I found out that there should be one part of HiveMind in the name, or something related to it (either Hive, Mind, or Bee) then the name had to include some reference to what it brings: transaction management.

A first name that I came out with was Hive-Trans, but soon I digressed a bit and thought that in some cases, bees could enter in some kind of trance or something and then the Hive Mind would just be that: a big trance (no, no, I did not smoke any forbidden substance before scratching my head on this name;-)). However, in my mother tongue, Trance is translated to Transe, and I stupidly thought that it was the same in English :-(

Hence this kinda stupid name!

Now you may wonder why this project changed name into "HiveMind Utilities". The reason is obvious: the project has evolved from transaction management to various other cross-cutting concerns to be brought to developers using HiveMind. However, since sourceforge does not allow renaming the "unix" name of a project (ie "hivetranse"), thus the URL has not changed and will probably never change in the future.

Why not reuse spring transaction?

The Spring framework is renowned for its excellent transaction facilities. Hence some people may wonder why reinventing the wheel with HiveTranse, why not try to integrate what exists in Spring?

As for me, the answer is simple and manyfold:

  • I don't know Spring (I mean the "guts" of it) and I did not feel like digging into it
  • I find that Spring configuration is very verbose, and I was wondering if a Spring integration would maybe impose configuration "ala Spring" to HiveMind users, which I would not like
  • I thought that HiveMind had a lot to provide for such a job (configuration points, interceptors...) and in an easy way for the end-developer
  • I found the challenge interesting for me to get good practice of HiveMind and discover new things (for me) about working with JTA (as of 0.7.1, this is not yet done however)

As a matter of fact, building such a system up to now (HiveTranse 0.7.1) was not as difficult as I thought. The major problems were to find out, among the many implementation choices given by HiveMind, the best one (ie, the most extensible, easiest to use and finally simplest to develop).

However, there is one open source project out there that performs this integration to spring transactions, but I think it is a tapestry-related project (HiveTranse is agnostic on the concern of web frameworks, it can also work in a client application in a 2-tiers architecture!)

Are there alternatives to HiveTranse when using HiveMind?

It first depends on your needs.

If you just need JDBC, and you do not mind managing Connections (open, commit, rollback) in your DAO code, then you can perfectly use a pooled DataSource (like jakarta commons-dbcp), declare it as a HiveMind service (this is what HiveTranse suggests for JDBC support), and inject it in your DAO, and, in each DAO method, use the DataSource to get a new Connection, use that Connection and commit it or roll it back.

If you just need Hibernate, and you do not mind about automatic transaction management (through declarative transaction demarcation like in EJB), you can choose one of some partial solutions suggested on HiveMind WIKI. But those solutions look more like attempts to integrate Hibernate and do not always provide extended configuration capabilities, or sometimes support only one SessionFactory. Generally those solutions also suffer a lack of documentation.

Among these solutions, one is particularly worth a look (and a try): it was developed by Marcus Schulte and is available on HiveMind's WIKI. It is interesting because it supports the Hibernate pattern "long sessions" (also known as "session-per-application"), which HiveTranse does not support currently (but shall support in the future).

Besides, you can still use Spring transaction framework and take advantage of Spring integration in HiveMind. Some projects have taken this direction. However, I believe such an approach does not fit very well in HiveMind configuration (since I think you will need to use -heavy- spring configuration files).

I would like to participate to the HiveMind Utilities project, what can I do?

First of all, the best way to help the HiveMind Utilities project is to use some of its modules in your own projects. You can also advertise your usage of HiveMind Utilities so that more people would consider using it with HiveMind.

Then, while using some HiveMind Utilities modules, you may encounter bugs or foresee enhancements. If so, just report to the HiveTranse trackers on Sourceforge. Even better, you can implement bug fixes and new or enhanced features to the forums. When you get experience about HiveMind Utilities, you can then participate to HiveTranse forums to answer others' questions, or discuss usage patterns, tips and tricks...

You might as well help writing some documentation or examples that ease the learning curve of some HiveMind Utilities modules.

When will we have a CVS repository for HiveMind Utilities?

The short answer is: never!

A longer answer follows:

I have made an attempt of setting up a CVS on SourceForge and it failed (because of me, not SF). I think I will try a new attempt in the future. However, now SF also supports Subversion, it will be worth investigating this path for HiveMind Utilities (considering future refactoring it will be a better solution than CVS).

It is worth to note that whenever the Subversion repository will be setup, it will not be populated with all the HiveMind Utilities history, but will probably contain only the last released version.

When will HiveTranse support Xxxxx?

First of all, check out the Roadmap page. However, as stated in this page, dates that are given do not constitute a mandatory milestone.

Currently, the HiveTranse "team" is just made of myself. I am working on HiveTranse "for the fun of it" and because I believe that HiveMind has a real potential as a very good IoC container (I prefer HiveMind to Spring) but lacks all "transversal" features (transactions, security...) that would make it usable for a real-world application. But working on HiveTranse is not what feeds me and my family, I have a daily job for a living.

All that is to explain that I cannot use as much time on HiveTranse as I would like. Hence, it is hard for me to tell when feature Yyyyy or ORM library Xxxxx will be supported.

What I can tell however is that there are some ways to influence on the priorities of features by "making a lot of noise" and convince that this feature is a "must have ASAP".

I don't understand why my application does not seem to work, what happens?

When you launch your application and that nothing works as you would expect, provided that you correctly unit tested your different services outside HiveMind, the first thing that you should check is the log generated by log4j (or whatever logging facility you use).

In general, from my experience, most errors you will encounter are due to configuration problems. The log file will report any errors reported by HiveMind about configuration. Since HiveMind, by default, does not stop when it encounters a configuration error, any configuration error can produce a problem much later.

As long as you have HiveMind errors, you should expect problems (sometimes ununderstandable) with your application; fortunately, HiveMind error reporting is "line-precise" and tells you exactly where the error can be found in your hivemodule.xml files.

After all HiveMind configuration errors have been removed, then you should check traces from other classes (in particular hivetranse classes), and also traces for your own classes.

How can I use Hibernate 3.1 Annotations with HiveTranse?

Starting in HiveMind Utilities version 0.4.7, hivetranse.hibernate3 provides support for Hibernate 3.1 Annotations.

Important: Please note that Hibernate 3.1 Annotations require Java 5.

Hibernate Annotations support in HiveTranse is transparent, you just have to make sure to have the necessary jar files in your classpath, if present, then HiveTranse will use them. That's all! All the rest is done by normal Hibernate configuration as usual.

HiveTranse also allows you to configure annotated classes and packages directly in your hivemodule.xml file.

<configuration-point    id="HibernateSettings"
                        schema-id="hivetranse.hibernate3.HibernateSettingsSchema"/>
<contribution configuration-id="HibernateSettings">
    <mapping package="com.acme.mypackage"/>
    <mapping class="com.acme.mypackage.MyPersistentClass"/>
    <mapping class="com.acme.mypackage.YourPersistentClass"/>
</contribution>

Important: Please note that current HiveTranse version, although it has support for Hibernate 3.1 Annotations, has not been tested on Java 5, hence Hibernate 3.1 Annotations support has not been tested yet either. If you encounter problems, please let us know. It is planned to soon start HiveMind Utilities tests on Java 5 (after version 0.5.0 release).

I get a ClassNotFoundException when using hivetranse.hibernate3

This exception is logged with a "DEBUG" severity, it is not an error!

This is due to the fact that hivetranse.hibernate3 will check the presence of Hibernate 3.1 Annotations library, so that if it finds it, it will automatically use it. However, if this library is not found, then this exception will occur. You can safely ignore it.