I'm trying to handle an issue we're having where all of our application's inserts or updates are first going through a MS SQL Server insteadof trigger which modifies the date_created and last_updated date fields. Since this application is deployed in a clustered environment we would like to use the date from the database in case any of the servers clocks get slightly out of synch.
The problem we're having is that the identity column that comes back (generated as "native") is null.
Is there some way to employ insteadof triggers like this but still use native id generation? I'd like to keep the strategy the same to preserve the portability of the application.
thanks,
Patrick
Hibernate version: 3
Mapping documents: This is a Grails application no mapping
Name and version of the database you are using: SQL Server 2005
The generated SQL (show_sql=true):
Hibernate: insert into carrier (version, alt_id_identifier_id, APP_ID_IDENTIFIER, APP_PLAN_ID_IDENTIFIER, business_address_city, business_address_line1, business_address_line2, business_address_line3, business_address_line4, business_address_state, business_address_zip, date_created, days_app_active, db_note, edi_grouping_identifier_id, edi_map_code, fax_number, last_changed_by, last_updated, mailing_address_city, mailing_address_line1, mailing_address_line2, mailing_address_line3, mailing_address_line4, mailing_address_state, mailing_address_zip, member_id_identifier_id, name, permanent_address_city, permanent_address_line1, permanent_address_line2, permanent_address_line3, permanent_address_line4, permanent_address_state, permanent_address_zip, phone_number, provider_directory_url, tax_id, uuid) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|