I believe autoincrement for Sybase has not been fully implemented by the
adaptor.

>From DBSybase.java

    /**
     * Returns the last auto-increment key.  Databases like Oracle
     * which support this feature will return a result, others will
     * return null.
     *
     * @return null.
     */
    public String getSequenceSql(Object obj)
    {
        return null;
    }


Use idbroker instead.

Tate Jones
-----Original Message-----
From: Brekke, Jeff <[EMAIL PROTECTED]>
To: 'Turbine' <[EMAIL PROTECTED]>
Date: Thursday, 1 March 2001 8:17
Subject: RE: Torque problem


>Well, we are using sybase's built in autoincrement, and in torque I have
>autoIncrement="true" on the auto-incremented columns, and also have
>IdMethod="autoincrement" on the table tag.  This uses the db's built in
>method and not IDBroker.
>
><table name="mine" idMethod="autoincrement">
>   <column name="key" primaryKey="yes" autoIncrement="true" ..... />
></table>
>
>Maybe you need to define your table this way.  There is a method in the DB
>adapter class which defines the sql to get the autoincremented value back
>using these native methods.  This worked for us, having torque generate the
>OM classes, and using them against a set of tables already created and
>defined as you describe.
>
>> -----Original Message-----
>> From: David Ramsey [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, February 28, 2001 1:55 PM
>> To: Turbine
>> Subject: Re: Torque problem
>>
>>
>> The VARCHAR2 is being mapped to String, yes. And I did pull the
>> parameters by hand, loaded a criteria, and called doUpdate(crit) with
>> the same result.
>>
>> Also, double checking the inserts, they just blow up with an
>> exception.
>> I am not at all interested in using the ID Broker for these
>> tables and I
>> was under the impression, given the light documentation on
>> Torque, that
>> setting autoincrement="false" would disable this but apparently it has
>> not. However, it is still attempting to access sequences that don't
>> exist, resulting in exceptions.
>>
>> Is there a way that I can disable the ID broker entirely? Every single
>> one of these tables at this company are covered with a before insert
>> trigger that uses their own sequencer to set the ID field the way they
>> want it. I don't need nor want the overhead of the ID broker but there
>> is nothing terribly clear about how to disable this "feature" at all.
>>
>> Torque is nice if you are starting from scratch and can control the
>> structure of the database. Often though I work with medium and large
>> scale companies that have existing databases and they are not going to
>> reorganize them, change sequencers, etc., just for one new app. So far
>> I've burned 3 days on a 10 day cycle screwing around with Torque and
>> Torque issues. I'll end up eating the time this weekend to make it all
>> work but I think I am going to shy away from Torque in the
>> future until
>> perhaps it improves. That means alot more raw JDBC code to
>> write but at
>> least I know that will work.
>>
>> "Brekke, Jeff" wrote:
>> >
>> > I've noticed that turbine is silent when an update fails
>> via save().  But
>> > everytime I've found that
>> > it is because I'm not setting a member properly.  Your sql looks
>> > interesting, what is VARCHAR2 is this being mapped to a string?
>> >
>> > Also, try to read the members out of data.getParameters()
>> by hand, throw
>> > them into a Criteria, and call SlaTypePeer.doUpdate(crit)
>> > and see if that works.
>> >
>> > For me 1.1a11 is working with sybase and mysql.
>> >
>>
>> --
>> David Ramsey -- [EMAIL PROTECTED]
>>
>> -- There is an old Vulcan proverb: only Nixon could go to China.
>>
>>
>> ------------------------------------------------------------
>> To subscribe:        [EMAIL PROTECTED]
>> To unsubscribe:      [EMAIL PROTECTED]
>> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
>> Problems?:           [EMAIL PROTECTED]
>>
>
>
>-----------------------------------------------------------------------
>
>This message has been scanned for viruses with Trend Micro's Interscan
VirusWall.
>
>
>------------------------------------------------------------
>To subscribe:        [EMAIL PROTECTED]
>To unsubscribe:      [EMAIL PROTECTED]
>Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
>Problems?:           [EMAIL PROTECTED]
>



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to