Does anyone have a solution for this? I am having the exact same problem.
I am also using Seam and JBoss 5.0. I have two datasources one is mySql and the other is Oracle.
My messageToClient entity class table is being created in both persistent units. The other classes are from another jar so those are fine. From the xml below it should only be created in the integration unit.
Here is my persistence.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="orderProcessor">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/orderProcessorDatasource</jta-data-source>
<jar-file>acquityOnDemand-ejb.jar</jar-file>
<class>com.acquitygroup.acquityondemand.entity.OrderHeader</class>
<class>com.acquitygroup.acquityondemand.entity.Address</class>
<class>com.acquitygroup.acquityondemand.entity.BillingAddress</class>
<class>com.acquitygroup.acquityondemand.entity.ShippingAddress</class>
<class>com.acquitygroup.acquityondemand.entity.Payment</class>
<class>com.acquitygroup.acquityondemand.entity.OrderLine</class>
<class>com.acquitygroup.acquityondemand.entity.ShippingOption</class>
<class>com.acquitygroup.acquityondemand.entity.ShippingPrice</class>
<class>com.acquitygroup.acquityondemand.entity.Sku</class>
<class>com.acquitygroup.acquityondemand.entity.Product</class>
<class>com.acquitygroup.acquityondemand.entity.SkuPrice</class>
<class>com.acquitygroup.acquityondemand.entity.PriceList</class>
<class>com.acquitygroup.acquityondemand.entity.ProductCategory</class>
<class>com.acquitygroup.acquityondemand.entity.Category</class>
<class>com.acquitygroup.acquityondemand.entity.Catalog</class>
<class>com.acquitygroup.acquityondemand.entity.Site</class>
<class>com.acquitygroup.acquityondemand.entity.Client</class>
<class>com.acquitygroup.acquityondemand.entity.CreditCard</class>
<class>com.acquitygroup.acquityondemand.entity.User</class>
<class>com.acquitygroup.acquityondemand.entity.UserRole</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/orderProcessorEntityManagerFactory"/>
</properties>
</persistence-unit>
<persistence-unit name="integration">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/integrationDataSource</jta-data-source>
<jar-file>orderProcessor-ejb.jar</jar-file>
<class>com.acquitygroup.orderprocessor.entity.MessageToClient</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/integrationEntityManagerFactory"/>
</properties>
</persistence-unit>
</persistence>
MessageToClient.java
Code:
package com.acquitygroup.orderprocessor.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.sql.Date;
@Entity
@Table(name = "MESSAGE_TO_CLIENT")
public class MessageToClient {
BigDecimal messageToClientId;
String clientCode;
String acquityId;
String type;
byte[] payload;
BigDecimal errorCount;
Date createTimestamp;
Date sendTimestamp;
String locked;
String finished;
Date finishTimestamp;
public MessageToClient(){}
public MessageToClient(BigDecimal messageToClientId, String clientCode,
String acquityId, String type, byte[] payload, BigDecimal errorCount,
Date createTimestamp, Date sendTimestamp, String locked,
String finished, Date finishTimestamp) {
this.messageToClientId = messageToClientId;
this.clientCode = clientCode;
this.acquityId = acquityId;
this.type = type;
this.payload = payload;
this.errorCount = errorCount;
this.createTimestamp = createTimestamp;
this.sendTimestamp = sendTimestamp;
this.locked = locked;
this.finished = finished;
this.finishTimestamp = finishTimestamp;
}
@Id
@SequenceGenerator(name="SEQ_MESSAGE_TO_CLIENT")
@Column(name="MESSAGE_TO_CLIENT_ID", unique = true, nullable = false)
public BigDecimal getMessageToClientId() {
return messageToClientId;
}
public void setMessageToClientId(BigDecimal messageToClientId) {
this.messageToClientId = messageToClientId;
}
@Column(name="CLIENT_CODE")
public String getClientCode() {
return clientCode;
}
public void setClientCode(String clientCode) {
this.clientCode = clientCode;
}
@Column(name="ACQUITY_ID")
public String getAcquityId() {
return acquityId;
}
public void setAcquityId(String acquityId) {
this.acquityId = acquityId;
}
@Column(name="TYPE")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Column(name="PAYLOAD")
@Lob
public byte[] getPayload() {
return payload;
}
....
}