This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Gidday, I've been trying to find information on what you can do in the AfterUp method of a Migration. I need to do some data migration after the database has been upgraded, but appear to be having issues with this. With no access to a context within the Migration, I just create one within the AfterUp method. I do some work, which seems to go fine, exit the scope of the using for the unit of work then out of the method. I then get a database timeout, which causes my service to shut down. Are there any limitations on what can be done in this method? |
|
|
AfterUp will be executed by the migrator for the given migration after the Up method has executed so this gives an opportunity to do any additional work like data migrations. All of these operations will need to be performed with the existing migration methods, e.g. ExecuteNativeCommand being the primary tool here so this is appropriate for any operations which can be scripted. While creating and disposing of a UOW within this call is possible its not intended - it sounds like you might be getting a blocking issue between one of the UOW operations and the transaction which the migration is operating under. When you exit this method the migration is committed which in turn causes the transaction to be committed so if this cant proceed you would see a database timeout.
|
|