[JCA/JBoss] - Datasource failover, sudden disconnection not working
by sebastianlacuesta
I have a problem using datasource failover with MySQL. My setup is JBoss at host A, and mysql in host B, replicated in host A. I have followed the instructions in JBossJCADatabaseFailover.
When I stop mysql at machine B with /etc/init.d/mysql stopfailover works flawlessly, but if I disconnect B's network cable, the application just keeps waiting for the query, and no failover is done. The datasource configuration is:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mysql-ds.xml,v 1.3.2.3 2006/02/07 14:23:00 acoliver Exp $ -->
<!-- Datasource config for MySQL using 3.0.9 available from:http://www.mysql.com/downloads/api-jdbc-stable.html-->
<ha-local-tx-datasource>
<jndi-name>PokUpdateDs</jndi-name>
<connection-url>jdbc:mysql://192.168.10.219:3306/POK2|jdbc:mysql://192.168.10.210:3306/POK2</connection-url>
<url-delimeter>|</url-delimeter>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>JBossAS</user-name>
MyPassword
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>10</idle-timeout-minutes>
<blocking-timeout-millis>300</blocking-timeout-millis>
<exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
<!-- should only be used on drivers after 3.22.1 with "ping" support -->
<valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
<!-- sql to call when connection is created
<new-connection-sql>select sysdate() from dual</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers -->
<check-valid-connection-sql>select sysdate() from dual</check-valid-connection-sql>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>mySQL</type-mapping>
</ha-local-tx-datasource>
The hosts are:
A: 192.168.10.210
B: 192.168.10.219
I could keep playing with blocking-timeout-millis, but I prefer to ask before continue. My question is: What should I have to consider in order to solve this? I mean, get failover working when a database stop working suddenly, not by stopping it cleanly.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030850#4030850
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030850
19Â years, 1Â month
[Persistence, JBoss/CMP, Hibernate, Database] - How to map a java double type in hibernate to oracle NUMBER?
by yangju
Sorry I have to repost this question as I forgot to include a title for the previous one.
I have struggled for days getting a java.lang.Double filed mapped to oracle NUMBER type with precision 4 and scale 1.
I tried this:
<column name="ValidityAgreePercent" sql-type="NUMBER(4,1)" />
and
<column name="ValidityAgreePercent" sql-type="NUMBER(4,1)" />
and
<column name="ValidityAgreePercent" sql-type="NUMBER precision="4" and scale="1 " />
And over two dozen combinations.
None worked.
Does this validation have anything to do with jdbc driver?
My dialect is Oracle9Dialect.
We use jboss 4.0.3SP1 (hibernate jars come with this jboss release).
This is what I got:
org.hibernate.HibernateException: Wrong column type: ValidityAdjacentPercent, expected: NUMBER(4,1)
at org.hibernate.mapping.Table.validateColumns(Table.java:205)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:956)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:299)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145)
at com.pearson.resource.adapter.jmx.jboss.hibernate.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:220)
at com.pearson.resource.adapter.jmx.jboss.hibernate.HibernateSessionFactory.startService(HibernateSessionFactory.java:100)
at com.pearson.epen.service.SessionFactoryDeployer.addSessionFactoryForDatasource(SessionFactoryDeployer.java:91)
at com.pearson.epen.service.DataSourceListener$DeployerThread.deploySessionFactory(DataSourceListener.java:416)
at com.pearson.epen.service.DataSourceListener$DeployerThread.run(DataSourceListener.java:393)
I even tried big_decimal. It does not work either.
The same mapping works for sql-server where we have decimal in the database as a type.
Please help. I don't see any example.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030840#4030840
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030840
19Â years, 1Â month
[JBoss jBPM] - Scheduled TaskInstances within a ProcessInstance?
by perrylucas
Our company is considering JBPM as a replacement for our current workflow management software (built in-house), but it seems to be missing a vital piece! Here's the scenario:
We need to assign several stateful properties, including Estimated Man Hours, Actual Man Hours, Due Date, etc to our Tasks/TaskInstances so that we can plan employees' workloads over the lifetime of a ProcessInstance. Upon creation of a ProcessInstance, however, only the first TaskInstance is available as only it is active... This obviously makes it impossible to do any kind of planning!
I have searched on the forum and have found many related topics but nothing that really hit home here, so before telling my boss that JBPM simply doesn't meet the requirements here, I'd like to know if anyone else has had the need and found a way to do this.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030822#4030822
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030822
19Â years, 1Â month