Mike
I'm on CFMX7 with hf2, in J2EE configuration, JRun 4 updater 5,
win2003, sql server 2000.
I've knockup up a test, and reproduced this on 2 dev servers, test and
staging, though i haven't tried it on live :)
<!---
/* script to create table with trigger which returns the ID column */
if exists (select * from dbo.sysobjects where id =
object_id(N'[my_table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.my_table
GO
CREATE TABLE dbo.my_table
(
my_id int NOT NULL IDENTITY (1, 1),
my_text varchar(50) NULL
) ON [PRIMARY]
GO
CREATE TRIGGER get_my_id ON dbo.my_table
FOR INSERT
AS
SELECT my_id AS my_new_id
FROM INSERTED
GO
--->
<cfset dsn = "trips2_hr">
<cfset text = "the time is #now()#">
<cfquery name="q_test" datasource="#dsn#">
INSERT INTO my_table (my_text)
VALUES ('#text#')
</cfquery>
<cfdump var="#q_test#">
When using DataDirect 3.3 it works, but when i upgrade to 3.4 JRun CPU
sticks at 50%, and the thread remains busy.
If i delete the trigger then it works on the 3.4 drivers.
I haven't had time to investigate this further than posting this mail...
Cheers
Bert
On 7/20/05, Mike Chabot <[EMAIL PROTECTED]> wrote:
> Bert,
> I have been returning new identities using triggers for years without any
> problems. It is working for me using CFMX 6.1 and the DataDirect
> 3.4drivers. I do not see any JRun CPU spike on my server. Are you
> suggesting
> that everything works without any error messages being generated, but JRun
> seems to consume more CPU than it should? I would be interested to know if
> you are able to find an answer to this problem. I would make sure you have
> applied the latest SQL Server and CFMX service packs / hotfixes.
> Good luck,
> Mike Chabot
> On 7/20/05, Bert Dawson <[EMAIL PROTECTED]> wrote:
> >
> > Years ago i picked up a way of returning the value inserted into an
> > Identity column in SQL server, by adding a trigger to that table:
> >
> > CREATE TRIGGER get_my_id ON dbo.my_table
> > FOR INSERT
> > AS
> > SELECT my_id AS my_new_id
> > FROM INSERTED
> > GO
> >
> > Then i can run:
> >
> > <cfquery name="q_test" datasource="#dsn#">
> > INSERT INTO my_table (my_text)
> > VALUES ('foo')
> > </cfquery>
> >
> > my new id = #q_test.my_new_id#
> >
> > I know i can use @@IDENTITY or SCOPE_IDENTITY(), but i was wondering
> > if the trigger method is a Bad thing to do...
> >
> > Its worked from CF4 to CFMX7, but barfs with the DataDirect 3.4
> > drivers: the insert happens, but JRun sits at 50%.
> >
> > Does that mean there's a bug with the driver, or something wrong with my
> > code?
> >
> > Cheers
> > Bert
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212372
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54