Category: Transfer
Managing the Transfer Cache with Clones
I had a bit of an adventure when dealing with the Transfer cache. This post sums up my misconceptions, and how I get things working the right way.
Read complete post
Dealing with Stamp and StampUpdated with Transfer
Continuing work on my top secret app and learning CCT (ColdBox, ColdSpring, and Transfer), I'm going to describe how to handle stamp and stampupdated columns in your tables. In every table that I have in any database I build, I have both a stamp and stampupdated column. The stamp column tells me when the record was originally created, and the stampupdated column tells me the last time that data changed. Both of these columns have a default value of getDate(). Here's the colum definition for an example table: CREATE TABLE [dbo].MyTable( [ID] [int] IDENTITY(1,1) NOT NULL, [Label] [varchar](50) NOT NULL, [stamp] [datetime] NOT NULL CONSTRAINT [DF_Items_stamp] DEFAULT (getdate()), [stampupdated] [datetime] NOT NULL CONSTRAINT [DF_Items_stampupdated] DEFAULT (getdate()), This works great on initial insert, but doesn't update the stampupdated column on each UPDATE. So to handle making sure the stampupdated gets taken care of properly I create a trigger on each table like so: CREATE TRIGGER [dbo].[MyTable_Update] ON [dbo].[MyTable] AFTER UPDATE AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for trigger here UPDATE MyTable SET stampupdated = getDate() FROM Inserted WHERE MyTable.ID = Inserted.ID END Now to handle these properly in Transfer, I can't have transfer updating and inserted those values, because the database is responsible for those actions. So let's take a look at what would be the standard property tags for those two columns: