XmlBlaster Logo

REQUIREMENT

queue.jdbc.ldbc

XmlBlaster Logo


Type NEW
Priority LOW
Status INWORK
Topic The common table plugin supports using the Liberty Database Connectivity Abstraction Layer.
Des
cription

The Liberty data base connectivity package http://ldbc.sourceforge.net/ provides vendor-independant database access. The org.xmlBlaster.util.queue.jdbc.JdbcQueueCommonTablePlugin is able to support the Liberty Abstraction Layer and has been
tested with the following database engines.
MySQL
Postgres
This code is currently beta and has only been tested with MySQL, Postgres and Hsqldb.
Hsqldb is known NOT to work at present.

See queue.jdbc.commontable for a description of the common table architecture.

Example
Java

This is a configuration example from xmlBlaster.properties:

Configuration for the ldbc driver in debug mode.
JdbcStorage[MySQL]=org.xmlBlaster.util.queue.jdbc.JdbcQueueCommonTablePlugin,\
           url=jdbc:ldbc:mysql://localhost/xmlb[ldbc.trace=detailed],\
      

It is not possible to use the ldbc trace to file functionality as the parameter format to pass the file name to ldbc will break
xmlBlasters parameter parsing.

[ldbc.trace=on] Method calls, parameters, exceptions and statements.

[ldbc.trace=detailed] All of On plus prepared statement and result set calls.

[ldbc.trace=off] Default is off.

See queue.jdbc.mysql for a full configuration example.

Configure

To activate persistence please add the following to your properties file:

persistence/topicStore/defaultPlugin=JDBC,1.0
persistence/msgUnitStore/defaultPlugin=CACHE,1.0

QueuePlugin[JDBC][1.0]=org.xmlBlaster.util.queue.jdbc.JdbcQueueCommonTablePlugin,\
                    url=jdbc:ldbc:mysql://localhost/xmlb,\
                    user=xmlb,\
                    password=secret,\
                    connectionPoolSize=1,\
                    connectionBusyTimeout=90000,\
                    maxWaitingThreads=300,\
                    tableNamePrefix=XB_,\
                    entriesTableName=ENTRIES,\
                    dbAdmin=true,\
                    cascadeDeleteSupported=false,\
                    nestedBracketsSupported=false,\
                    configurationIdentifier=ldbc
                    
QueuePlugin[RAM][1.0]=org.xmlBlaster.util.queue.ram.RamQueuePlugin
QueuePlugin[CACHE][1.0]=org.xmlBlaster.util.queue.cache.CacheQueueInterceptorPlugin,\
persistentQueue=JDBC,transientQueue=RAM

queue/subject/defaultPlugin=CACHE,1.0
queue/history/defaultPlugin=CACHE,1.0
queue/callback/defaultPlugin=CACHE,1.0
useTopicStore=true

JdbcDriver.drivers=org.ldbc.jdbc.jdbcDriver

JdbcDriver.mapping[ldbc]=string=varchar(128),"longint=decimal(19,0)",int=int,boolean=char(1),\
		blob=blob,pingStatement=Show All,blobVarName=ablob, keyAttr=not null
     
Property default comment
persistence/topicStore/defaultPlugin JDBC,1.0 The default persistance topic store plugin.
persistence/msgUnitStore/defaultPlugin CACHE,1.0 The default persistance message unit store plugin.
url jdbc:ldbc:mysql://localhost/xmlb The database url string. Example jdbc:ldbc:mysql://localhost:3306/xmlb
user xmlb The database user name.
password secret The database password
connectionPoolSize 1 The number of connections to the DB (tests showed that a low number gives the best performance).
connectionBusyTimeout 90000 The time to wait in milliseconds until to timeout when waiting for a connection to the DB.
maxWaitingThreads 300 The maximum number of threads waiting for a connection to the DB.
tableNamePrefix XB_ the name prefix for the table containing the entries. Note that the complete names for the tables are created by adding the tableNamePrefix to the names. So if you specify entriesTableName=ENTRIES and tableNamePrefix=XB_ you will get the name of the table to be XB_ENTRIES.
entriesTableName ENTRIES the name postfix for the table containing the entries.
dbAdmin true if set to true xmlBlaster will try to create tables if needed.
cascadeDeleteSupported false Ldbc does not currently support cascade delete. A code work around has been put in place.
nestedBracketsSupported false Ldbc does not support nested brackets in some queries.
configurationIdentifier ldbc The identifier used for database mapping. See JdbcDriver.mapping[ldbc]
maxStatementLength 2048 The maximum SQL statement length supported by this JDBC driver. If the JDBC meta data delivers this information this property is ignored.
enableBatchMode true Tells the driver to make the addition of entries in batch mode, i.e. several entries are added in the same sweep. This can improve performance on some DB's significantly. The drawback is that it could loose performance and create noisy logs in the case you insert several entries and one of them is already in the DB. Then everything would be rolled back and repeated in single mode (we can not save the current state since PostGres implicitly aborts transactions in case of an SQLException is thrown). If the DB used does not support batch mode, then this option is ignored.
QueuePlugin[RAM][1.0] org.xmlBlaster.util.queue.ram.RamQueuePlugin Ram based plugin.
QueuePlugin[CACHE][1.0] CacheQueueInterceptorPlugin,
persistentQueue=JDBC,
transientQueue=RAM
Cache plugin.
queue/subject/defaultPlugin CACHE,1.0 The queue subject default plugin.
queue/history/defaultPlugin CACHE,1.0 The queue history default plugin.
queue/callback/defaultPlugin CACHE,1.0 The queue callback default plugin.
useTopicStore false Use the topic store.

NOTE: Configuration parameters are specified on command line (-someValue 17) or in the xmlBlaster.properties file (someValue=17). See requirement "util.property" for details.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.

See API org.xmlBlaster.util.queue.I_Queue
See API org.xmlBlaster.util.queue.jdbc.JdbcQueueCommonTablePlugin
See API org.xmlBlaster.util.queue.QueuePluginManager
See API org.xmlBlaster.util.queue.I_QueueEntry
See API org.xmlBlaster.util.qos.storage.QueuePropertyBase
See API org.xmlBlaster.util.I_Plugin
See API org.xmlBlaster.util.Global
See REQ queue
See REQ queue.jdbc.mysql
See TEST org.xmlBlaster.test.classtest.queue.I_QueueTest
See TEST org.xmlBlaster.test.classtest.queue.JdbcQueueTest

This page is generated from the requirement XML file xmlBlaster/doc/requirements/queue.jdbc.ldbc.xml

Back to overview