Question: I've just recently started using hibernate and so I apologize if this is a stupid question.

I want to package some of my code into a module which different applications can then utilize.
For example, a package that handles sending SMS messages.
This package does some database work to get basic config data and then might do some transaction logging.
This will then be added to applications requiring SMS functionality.
The package would therefore require the calling application to contain the specific config and logging tables required by the package.

My problem is that in order to write the hibernate methods that get the config and do the logging it needs to know of the hibernate specific DOA objects. The problem is these objects are only generated when we create the specific application database mapping.

Answer: 
The choices of how to do a timer vary in ease of use, portability, accuracy, ugliness (global state/signals), and suitability for realtime applications. Personally, for the best of all worlds, I would recommend rolling your own timer with a thread, and using `clock_nanosleep` with the `TIMER_ABSTIME` flag and the `CLOCK_MONOTONIC` clock source. This way you can avoid accumulated error and discontinuities from setting the system time, and you can count overruns yourself. In theory, POSIX `timer_create` with `SIGEV_THREAD` delivery should give you the same properties, but the glibc implementation is really bad and cannot guarantee that it will not lose timer expiration events under heavy load.
If you just have to output "Hello world" once every 10 seconds, I guess sleeps and nanosleeps will do. If your tasks are somehow more critical, you could take a look to RealTime Linux. There
(www.ee.nmt.edu/~rison/ee352\_fall09/Getting\_Started\_with\_RTLinux.pdf) they put a good guide on that. When using RTLinux you can use `pthread_make_periodic_np` to make a task periodic, though you'll be the one in charge of making sure that real time conditions are satisfied.