Link to home
Start Free TrialLog in
Avatar of davidcahan
davidcahanFlag for United States of America

asked on

FILESTREAM and Converted Video Files

My companies application requires a very strong tie between regular/traditional database data and files.  A file is useless without it's data and data is useless without the file.  They are tightly bound to each other.  So I'm thinking about using FileStream datatype.  

I've managed to answer most of my questions regarding how it would work, how to download files to the client machines that need them, etc., but I'm unable to determine one thing.

Often times users will be uploading files that need to be converted first before going into the DB.  The file is of course attached to traditional data, like the name the user gives it, a description, cloud tags attached to it, etc, so I want everything in a transaction that I can rollback if something goes wrong.  

So how the heck would I upload a file, then convert that file to say a swf and still insert it all into the DB?  Would I upload and insert first and then have a second process which selects the data out, converts it to swf and updates the record?

Thanks
Avatar of Aaron Shilo
Aaron Shilo
Flag of Israel image

hi

i would stage the process.

this means uplload the file to a stage area process(convert) and only then load it into the database.

this will give you the option of cancelling , error handling, without creating a problem in the prod env.
ASKER CERTIFIED SOLUTION
Avatar of DBAduck - Ben Miller
DBAduck - Ben Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davidcahan

ASKER

If you use Win32 API, how do you:
a)  update the row in the DB to flip the flag to "IsConverted = True"  and
b) Win32 API still needs to know the pointer to the file and that has to happen through the DB, correct?

Also

If a file takes 30 seconds to upload and I'm using Transactions am I locking the entire table during that process or does SQL take care of that part and only lock once the stream is up to the server?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial