OpenJMS with Firebird 1.5.3
chris lau <ckl_88-FFYn/[email protected]> Wed, 2 Aug 2006 20:57:46 -0400 (EDT)
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
just wanted to let everyone know that I have successfully configured OpenJMS with Firebird v1.5.3.
I'm writing this post because in the docs and website, there is no mention of Firebird being
supported.
Components you will need:
1. openjms (using 0.7.7-alpha-3)
2. Jaybird jca-jdbc driver (using 2.0.1)
3. Firebird installed and running correctly (using 1.5.3).
4. JRE (using 1.5.0)
Basically, the most important step is the openjms.xml configuration. Here is the important piece
of xml:
<DatabaseConfiguration>
<RdbmsDatabaseConfiguration
driver="org.firebirdsql.jdbc.FBDriver"
url="jdbc:firebirdsql:localhost/3050:c:/Firebird/Data/mydb.fdb"
user="sysdba"
password="masterkey"
maxActive="10"
maxIdle="5"
evictionInterval="3600"
testQuery="select * from client"/>
</DatabaseConfiguration>
As you can see, I have connection pooling parameters there so if you don't want pooling, just take
those entries out (ie. maxActive, maxIdle, evictionInterval, testQuery).
The URL you see above has a hardcoded path to the database (ie. c:\firebird\data\mydb.fdb). Just
replace this with the path to your database.
Localhost is the machine where the database resides so if your JMS server is a separate machine
from your database server, you need to change this to either an IP address or a machine name.
User/Password is the username and password combination to log into the database.
Table Creation
Contrary to what the docs say, I manually ran the create_interbase.sql script (which works for
Firebird) to create the tables. I got a couple of errors on primary key creation mainly because
some keys were defined too big. For example, the consumers table uses the "name" column as a key,
but Firebird won't accept that because the size of 255 chars is too big. So, in a hurry to get
things to work, I skipped the primary key for that table.
Classpath
Here is the big gotcha... Although, I had the jaybird-full-2.0.1.jar in my classpath (as defined
in a Windows environment variable), openjms was not able to find it. I kept getting the "Cannot
load JDBC driver class 'org.firebirdsql.jdbc.FBDriver'" message. Then after a few minutes, I
noticed that openjms was setting it's own classpath because it is displayed when you run the
startup.bat file. So in order for openjms to use the jaybird jar file, I modified setenv.bat and
appended the path to the classpath line in that file.
I have done some testing by creating a durable subscriber for topic1 and have published some
messages which the durable subscriber has received. However, I have noticed that the messages in
the messages table are not being deleted. I looked around the website and found a changelog that
says this problem is corrected... so will it be in the next release?
Anyway, I hope somebody will find this information useful.
Thanks.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV