On Tue, 2006-05-23 at 18:00 +0200, Tore Halset wrote:
> On May 23, 2006, at 10:34, Øyvind Harboe wrote:
>
> > As far as I can tell JdbcPkGenerator.autoPkTableExists() is flaky
> > w/MSAccess.
> >
> > This is a problem when I try to run the JUnit tests as it leads to
> > exceptions when JdbcPkGenerator.createAutoPk() tries to create the
> > AUTO_PK_SUPPORT table when the table already exists.
> >
> > It is almost as if the md.getTables(null, null, "AUTO_PK_SUPPORT",
> > null)
> > returns stale information.
>
> If getTables() does not work, perhaps you could issue a "select *
> from AUTO_PK_SUPPORT" in your own PkGenerator and look for
> SQLExceptions?
I've had the chance to do some more testing and as long as I add
a 3 second pause before I run autoPkTableExists(), then the current
JdbcPkGenerator implementation of autoPkTableExists() runs fine.
protected boolean autoPkTableExists(DataNode node) throws SQLException {
/* FIX!!!!! why is a 3 second pause necessary here???? */
try
{
Thread.sleep(3000);
}
catch (InterruptedException e1) {
e1.printStackTrace();
}
return super.autoPkTableExists(node);
}
-- Øyvind Harboe http://www.zylin.com
This archive was generated by hypermail 2.0.0 : Wed May 24 2006 - 08:35:39 EDT