I am trying to copy of a subset of tables (and subset of rows within
those tables) from an Oracle to MySQL. I'm able to connect to both
just fine and am able to get the objects just fine from Oracle, but
when I try to save them back to MySQL nothing happens. If I do
something straight up like:
BillingControl bc = new BillingControl();
bc.setAccountNumber("Foo");
bc.setCustomerId("Bar");
mysql.store(bc);
the new item is stored, but when I try to loop over the Oracle objects
as in:
query = new QueryByCriteria(BillingControl.class, null);
iter = oracle.getIteratorByQuery(query);
while (iter.hasNext())
{
BillingControl bc = (BillingControl) iter.next();
mysql.store(bc);
}
Nothing shows up in the mysql tables. I then tried to copy the objects
to see if that changed anything:
query = new QueryByCriteria(BillingControl.class, null);
iter = oracle.getIteratorByQuery(query);
while (iter.hasNext())
{
BillingControl bc = (BillingControl) iter.next();
BillingControl n = new BillingControl();
BeanUtils.copyProperties(n, bc);
mysql.store(n);
}
and still nothing happens.
I realize using OJB may be a bit slower than raw sql or something, but
this is only going to happen once a day and this insulates this code
from column changes (ie. some of the tables have _large_ numbers of
columns and we only need a handful of them).
No errors are getting logged, no exceptions thrown or anything. I'm
using ojb 1.0-rc1 w/ the following repository_database.xml:
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="MySQL"
protocol="jdbc"
subprotocol="mysql"
driver="com.mysql.jdbc.Driver"
jdbc-level="3.0"
dbalias="//host/db"
username="username"
password="password"
batch-mode="false"
useAutoCommit="0"
ignoreAutoCommitExceptions="false"
/>
<jdbc-connection-descriptor
jcd-alias="oraclecv"
default-connection="false"
protocol="jdbc"
subprotocol="oracle"
platform="Oracle"
driver="oracle.jdbc.driver.OracleDriver"
jdbc-level="2.0"
dbalias="thin:@host:1521:XCV1"
username="username"
password="password"
batch-mode="false"
useAutoCommit="0"
ignoreAutoCommitExceptions="false"
/>
Any thoughts? Thanks!
cdh
--
Chris D. Halverson http://www.halverson.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]