[Persistence, JBoss/CMP, Hibernate, Database] - newbie: import script questions
by mars1412
1) what character encoding do I need to use for the import.sql file: ISO-8859-1 or UTF-8
2) when you have master-child data to insert, what is the best way to do it?
since I am using MS-SQL database, the ID's will be generated by the database, so I must do this:
insert into ParentTable (field1, field2, ..) values (..)
| insert into Child Table (filed1, field2, .., ParentId) values (..., 1)
| insert into Child Table (filed1, field2, .., ParentId) values (..., 1)
| insert into ParentTable (field1, field2, ..) values (..)
| insert into Child Table (filed1, field2, .., ParentId) values (..., 2)
* this is not really nice, that I have to "guess" the parent id
| * the other thing is, that when you ever change your database to e.g. oracle, you have to completely rewrite your importscript: e.g. in this case, you have to add the id field for every row
| insert into ParentTable (id, field1, field2, ..) values (1, ..)
| | insert into Child Table (id, filed1, field2, .., ParentId) values (1, ..., 1)
| | insert into Child Table (id, filed1, field2, .., ParentId) values (2, ..., 1) is there a better way?
maybe I should not use the updatescript at all and create the data on application startup in java-code - then I could insert my entities and didn't have to care about the underlying database, right?
3) is this right:
the import.sql not really has anything todo with hibernate - it's just an importscript and hibernate automatically executes it against your database at startup (if configured)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131069#4131069
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131069
18 years, 2 months
[JBoss Messaging] - Re: JBM 1.4.0.SP3 JMSX properties bug
by jkwalnutCC
Yes, this is related to the other issue. The Oracle provider is setting the JMSX properties which causes the exception within JBoss.
My workaround was for JBoss is to ignore those properties and NOT throw the exception.
JBossMesage.java:
public void setObjectProperty(String name, Object value) throws JMSException
| {
|
| if (JMS_JBOSS_SCHEDULED_DELIVERY_PROP_NAME.equals(name) && value instanceof Long)
| {
| this.scheduledDeliveryTime = ((Long)value).longValue();
| return;
| }
|
| // Ignore JMSX properties.
| // Click Commerce workaround for using bridge with OC4J JMS Provider.
| if (isJMSXProperty(name))
| return;
|
|
|
| /**
| * Click Commerce workaround for using bridge with OC4J JMS Provider.
| *
| * Check the property name to see if it is a JMXS property. JMSX properties
| * should not be propagated. This method is used to determine if the given property
| * is eligable to be ignored.
| *
| * Note this method was introduced as a work around to JBoss JBM JIRA ticket See:
| * http://jira.jboss.org/jira/browse/JBMESSAGING-1224
| *
| * Note checkProperty() will throw an exception when a JMSX propery is encountered.
| *
| * @param name the property name
| * @return boolean true indicating the property is a JMSX property or
| * false if the property is not a JMSX property.
| */
| boolean isJMSXProperty(String name)
| {
| if (name.startsWith("JMSX") &&
| !name.equals("JMSXGroupID") &&
| !name.equals("JMSXGroupSeq") &&
| !name.equals("JMSXDeliveryCount"))
| {
| return true;
| }
| else
| {
| return false;
| }
| }
|
|
This was used with Oracle Application Server 10.1.2
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131060#4131060
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131060
18 years, 2 months