views:

45

answers:

1

I'm working with the persistence and tracking services in Workflow Foundation and I thought it would be a good idea to use a separate schema in SQL Server just for workflow.

Unfortunately, it appears they hard-coded the default dbo schema name into their code. One example is the SqlTrackingService class. Due to the way they wrote the tracking classes, I can't override the methods to provide my own db query code.

I have thought about the following options, but some don't appear to be possible:

  • Re-write tracking from scratch
  • Disassemble and re-write tracking files (Licensing violation?)
  • Some way to intercept and re-write sql query
  • Some way to trick it into using a custom version of SqlCommand that filters CommandText
  • Just go ahead and use the dbo schema for the WF stuff
  • Use a completely separate database for WF.

Does anyone have any suggestions or options I haven't considered? Thanks.

+1  A: 

In most cases I just accept the dbo scheme and sometimes move things into a separate database. As far as I know there is no way to intercept the commands and rewrite the scheme or table names but then I never tried either. If you want to rewrite, I did a port, SqlCeWorkflowPersistenceService, to SQLCe and LinqToSql. Feel free to use and/or modify it to fit your needs. See here for the code. It does pretty much the same thing as the default SqlWorkflowPersistenceService except for the ownership part which is broken anyway.

Maurice
Thanks. I guess using the dbo schema or using a different database is the easiest route. I did, however, find a way to intercept and rewrite sql queries. While not very clean, it does do what I want and probably has other uses as well.
Dan