Version 15

    How do I change the database from hypersonic?

     

    3.2.x

     

    JBossMQ
    uses it for message persistence, security and state

    For 3.2 only JBossMQ uses it.

     

    CMP - entity beans

    It is referenced in conf/standardjbosscmp-jdbc.xml as the default database/mapping.

     

    4.0.x

     

    From JBoss4 other services use it:

     

    The Timer service in deploy/ejb-deployer.xml (4.0.1+)

     

    Change the DataSource attribute to reference your JNDI name

    <!-- A persistence policy that persistes timers to a database -->
    <mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy"
           name="jboss.ejb:service=EJBTimerService,persistencePolicy=database">
       <!-- DataSource JNDI name -->
       <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
       <!-- The plugin that handles database persistence -->
       <attribute name="DatabasePersistencePlugin">org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin</attribute>
    </mbean>
    

     

    It also requires that you reference the correct db metadata from conf/standardjbosscmp-jdbc.xml in your -ds.xml. See the examples in docs/examples/jca

    e.g. in mysql-ds.xml

    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    <metadata>
    <type-mapping>mySQL</type-mapping>
    </metadata>
    

     

    The Timer service in deploy/ejb-deployer.xml (4.0.0)

     

    4.0.0 had more difficult configuration.

     

    Change the DataSource attribute to reference your JNDI name

    and modify the type "other" to be the correct "blob" type for your database.

    See conf/standardjbosscmp-jdbc.xml for the java.lang.Object mapping of your db

    if you are not sure.

    !-- A persistence policy that persistes timers to a database -->
    <mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=database">
    <!-- DataSource JNDI name -->
    <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
    <!-- table name -->
    <attribute name="TableName">TIMERS</attribute>
    <!-- Column that contains the timer id -->
    <attribute name="TimerIdColumn">TIMERID</attribute>
    <!-- Column that contains the target component id -->
    <attribute name="TargetIdColumn">TARGETID</attribute>
    <!-- Column that contains the initial date value -->
    <attribute name="InitialDateColumn">INITIALDATE</attribute>
    <!-- Column that contains the optional interval value -->
    <attribute name="IntervalColumn">INTERVAL</attribute>
    <!-- Column that contains the optional entity bean pk object -->
    <attribute name="InstancePkColumn">INSTANCEPK</attribute>
    <!-- Column that contains the optional info object -->
    <attribute name="InfoColumn">INFO</attribute>
    <!-- Create table DDL -->
    <attribute name="CreateTableDDL">
    create table TIMERS (
    TIMERID varchar(50) not null,
    TARGETID varchar(50) not null,
    INITIALDATE timestamp not null,
    INTERVAL bigint,
    INSTANCEPK other,
    INFO other,
    constraint timers_pk primary key (TIMERID)
    )
    </attribute>
    </mbean>
    

     

    Noop Timer

     

    If you don't care about timers surviving a reboot change it to use the noop policy.

     

    <attribute name="PersistencePolicy">jboss.ejb:service=EJBTimerService,persistencePolicy=noop</attribute>
    

     

    For 4.0.x

    <mbean code="org.jboss.ejb.txtimer.NoopPersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=noop"></mbean>
    

     

    Then uncomment the noop mbean and comment out the database mbean.

     

    uuid generation in uuid-key-generator.sar/META-INF/jboss-service.xml

     

    You can just delete this file unless you want to use it to generated UUID

    as primary keys in your entity beans.

     

    JUDDI database in juddi-service.sar/juddiws.war/WEB-INF/jboss-web.xml and juddi.properties

     

    You can just delete this file unless you use UDDI.

     

    ebXML Registry in deploy/ebxmlrr-service.sar/META-INF/jboss-service.xml (4.0.0)

     

    Change the explicit dependency to match your datasource's name:

     

    <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
    
    

     

     

    Using Multiple Databases with JBoss

     

     

    Referenced by: