Re: error committing new created object

From: Lothar Krenzien (lkrenzie..eb.de)
Date: Thu Jan 05 2006 - 06:12:19 EST

  • Next message: Lindsay Steele: "Postgres auto sequences"

    Thanks Andrus. I didn't realized that the table use identity columns because of the known problems we normally don't use auto generated keys. I think I will try jTDS now.

    cayenne-use..bjectstyle.org schrieb am 05.01.06 10:50:06:
    >
    >
    > On Jan 4, 2006, at 11:53 AM, Lothar Krenzien wrote:
    >
    > > Caused by: java.lang.AbstractMethodError:
    > > com.microsoft.jdbc.sqlserver.SQLServerConnection.prepareStatement
    > > (Ljava/lang/String;I)Ljava/sql/PreparedStatement;
    >
    > Generated keys support on MS SQLServer is very confusing as I've
    > mentioned in other threads. In your case the problem is that MS
    > driver does not support this feature, hence the exception.
    >
    > My suggestion is to (a) manually configure adapter on startup to
    > suppress the use of JDBC API for generated keys (see the code below)
    > and (b) leave PK mapped as "generated" to avoid another problem
    > described here:
    >
    > http://objectstyle.org/cayenne/lists/cayenne-user/2006/01/0038.html
    >
    > Here is the code:
    >
    > DataDomain domain = Configuration.getSharedConfiguration().getDomain();
    > DataMap map = domain.getEntityResolver().lookupObjEntity
    > (TblImportAlert.class).getDataMap();
    > DataNode node = domain.lookupDataNode(map);
    > JdbcAdapter adapter = (JdbcAdapter) node.getAdapter();
    > adapter.setSupportsGeneratedKeys(false);
    >
    >
    > ... or switch to jTDS driver that supports generated keys on SQL Server:
    >
    > http://jtds.sourceforge.net/
    >
    > Andrus

    ______________________________________________________________
    Verschicken Sie romantische, coole und witzige Bilder per SMS!
    Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



    This archive was generated by hypermail 2.0.0 : Thu Jan 05 2006 - 06:12:22 EST