inutan
inutan

Reputation: 10888

Fluent Nhibernate - Saving object to database

My WCF service is a reporting service - create reports and send them as email. Reports in the email can be an attachment/email body depending on the requirement.

Now, client wants to preview emails before they are being sent out, so my WCF service needs to return whole email object to calling web app. If client is happy with emails object, they can simply click 'Send out' which will then again call WCF service to send the emails.

I was thinking to save Email objects in database before they are sent to client for review. What would be the best approach to save email object in my scenerio considering:

Thank you!

Upvotes: 0

Views: 462

Answers (1)

jonnii
jonnii

Reputation: 28312

It all depends on how long it takes the reports to generate. If it's a matter of seconds then just recreate the report using the same parameters as the original request. If your app is anything like mine then the majority of the reporting time is spent in the database, in which case it might be satisfactory to store the formatted data returned from the query/stored procedure somewhere accessible, for example in the temp directory of the server.

I wouldn't recommend storing the binary email objects or anything of that nature in a database.

Upvotes: 2

Related Questions