22Apr/103
Switching from C3P0 to BoneCP: mind the numbers…
Now and then you want to hit yourself. Or shoot yourself in the head. Like I did today.
Recently, we've been experimenting with BoneCP. Mainly because C3P0 isn't really Java 6 compatible anymore, but also because I like the multithreaded nature of BoneCP. Alas, I forgot to do one thing when switching to BoneCP: look at the documentation of the configuration options. See, C3P0 has timing for idle checks, database checks and so on... When I switched to BoneCP, I just reused those timings, since they worked nicely for the setup we're using.
The catch? Well... C3P0 uses second or millisecond timings, BoneCP uses minute timings. Ouch. So what did we learn today? Measure and read, don't assume. I for one won't make this mistake again.
April 22nd, 2010 - 15:16
Hi,
I just used minutes instead of seconds because by default databases measure idle timeouts etc in *hours* so seconds appeared to be too fine grain there.
Cheers!
Wallace (BoneCP author)
April 23rd, 2010 - 09:48
You’re right, seconds or smaller are not so comfortable. However, you’re using milliseconds when outputting the settings using debug logging. Perhaps you’d want to change it there too?
April 23rd, 2010 - 10:49
Good catch! Fixing this right away – thanks for reporting.