Sounds like trying to get help from e.g. the derby (postgreSQL) folks
might be an option as well.
Werner
Stephen Ince wrote:
Werner,
Close. I have db2, sqlserver,oracle and hsqldb working but derby and
postgresql are kicking my .....
I don't think it is a castor issue. I think it has something todo
with the postgres and derby jdbc drivers.
I am still getting read-only transactions error for both derby and
postgresql. Even after adding the following statements to
SQLEngine.create, SQLEngine.store and SQLEngine.delete methods.
try {
if(((Connection)conn).isReadOnly())((Connection)conn).setReadOnly(false);
} catch(Exception e){;}
I think my best bet will be turned on tracing.
Steve
----- Original Message ----- From: "Werner Guttmann"
<[EMAIL PROTECTED]>
To: <[email protected]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 08, 2008 6:11 AM
Subject: Re: [castor-user] derby IDENTITY key generator
So that means that you are running again ?
Werner
Stephen Ince wrote:
I resolved the issue. The bug was in
org.exolab.castor.jdo.keygen.IdentityKeyGenerator.
public void supportsSqlType( int sqlType )
// derby doesn't support numeric as an identity column
// if (sqlType != Types.NUMERIC &&
if (sqlType != Types.NUMERIC &&
fName.equals("derby")) {
throw new MappingException(
Messages.format("mapping.keyGenSQLType",
getClass().getName(), new Integer(sqlType)));
}
}
----- Original Message ----- From: "Stephen Ince" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, February 07, 2008 8:14 PM
Subject: [castor-user] derby IDENTITY key generator
I am trying to use IDENTITY key generator but I am getting the
follow error. Do I need to set a data type for the INDENTITY key
generator? I looked at the 1.01 code and Integer is supported. Am I
missing something?
Error
-----------------------------------------------------------------------------------
0 [main] FATAL engine.BaseFactory - A fatal exception occurred:
org.exolab.cast
or.mapping.MappingException: Key generator
org.exolab.castor.jdo.keygen.Identity
KeyGenerator doesnt support SQL type {1}.
Here is a sample test case.
SQL
----------------------------------------
create table my_class (
id int not null primary key generated by default as
identity ,
string_value varchar(200) not null
) ;
mapping
------------------------------------------
<class name="test.MyClass" identity="id" key-generator="IDENTITY">
<map-to xml="my-class" table="my_class"/>
<field name="id" type="integer">
<bind-xml transient="true"/>
<sql name="id" type="integer"/>
</field>
Steve
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email