This is a migrated thread and some comments may be shown as answers.

WCF, big files, byte[]

1 Answer 44 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anton Sharov
Top achievements
Rank 1
Anton Sharov asked on 27 Apr 2010, 01:35 PM
Hello everybody!

I have a wcf service which receives and stores huge files (~1GB) in DB. OpenAccess mapped varbinary(max) to byte[], so I need to convert streamed data to byte[] (I use code like that ) and I get OutOfMemoryException. I want to ask if there are best practices to save huge files to DB with OpenAccess.

Thanks in advance,

1 Answer, 1 is accepted

Sort by
0
Accepted
Jan Blessenohl
Telerik team
answered on 29 Apr 2010, 12:24 PM
Hi Anton Sharov,
There is no way to efficiently tunnel the stream operations through OpenAccess, we are working on an API that gives out the ado connection, but it is still some months away.

The best way is to have your own ado connection, store the clobs in a second table and store only the id in your Persistent object. If you need a transaction around both operations you have to use System.Transactions.

Best wishes,
Jan Blessenohl
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Databases and Data Types
Asked by
Anton Sharov
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or