Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Data Warehousing / May 2006

Tip: Looking for answers? Try searching our database.

Why won't DSO multi-thread ???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Al - 14 Mar 2006 10:46 GMT
Hi,

I've written a little app, in C# with the 1.1 .Net Framwork, to process
partitions. It can use multiple threads to connect to the same AS2000
database and process the partitions. The work list is divided up between the
thread instances before they are started, so we know they are not blocking
each other. And any given cube is not processed by more than 1 thread.

When we run with 2 threads, on a 2 CPU machine, our through-put drops by 30%.
If we run 2 instances of the APP, with 1 thread each, our through-put goes
up by 30%.

It seems that clsPartition.Processs method is the sticking point, although
each thread has it's own instance. Is this something to with the properties
of the clsPartition class?
Vladimir Chtepa - 14 Mar 2006 15:26 GMT
Hi,

Do you set MTA/STA attribute respectively?
Do you open connection with server in the same thread as it used?

IMHO, it is better to use multiple processes to interoperate with COM-world
(DSO) definitively from one thread. (I make so too).

Vladimir

> Hi,
>
[quoted text clipped - 14 lines]
> properties
> of the clsPartition class?
Steve G - 14 Mar 2006 16:51 GMT
If you are trying to process multiple partitions or dimensions in parallel
using .net code which calls AS2K DSO, forget it. DSO is COM, and the code
will serialize in the COM calls even if you create multiple threads from your
own .net code. To do it, you need to create a seperate program (or use the
processpartition.exe utility to do the processing) and then create/launch
multiple processes from your .net code in the background. The .net code can
poll those processes and check when they have completed.

Steve Green

> Hi,
>
[quoted text clipped - 11 lines]
> each thread has it's own instance. Is this something to with the properties
> of the clsPartition class?
Al - 29 Mar 2006 15:31 GMT
Hi Steve,

Got it to work in the end.

The trick was to set the apartment state of my work threads to STA.

It seems counter-intuitive, but it really works. The CPU utilization is up,
run time is down and the Analysis Services performance counters show that we
are processing more than one partition at a time.

I don't really understand it, but what I THINK is that when I didn't set the
apartment state of my worker threads, it was treating it a MTA. But the DSO
objects were ALL created within the same STA. With the worker threads set to
STA, the DSO objects were created in seperate STA apartments.

If I'm talking rubbish, please let me know, as I would like to understand
this area better.

Alastair

> If you are trying to process multiple partitions or dimensions in parallel
> using .net code which calls AS2K DSO, forget it. DSO is COM, and the code
[quoted text clipped - 21 lines]
> > each thread has it's own instance. Is this something to with the properties
> > of the clsPartition class?
Steve G - 30 May 2006 08:41 GMT
Al,
I never got that to work, but if you say you've done it then you know more
than I do. I did try setting MTA/STA but never got anywhere. I've moved on to
2005 AMO now so (theoretically) it isn't an issue. We're looking at using
SSIS to do the parallel processing now, although there are other problems
involved in that approach.

Steve

> Hi Steve,
>
[quoted text clipped - 41 lines]
> > > each thread has it's own instance. Is this something to with the properties
> > > of the clsPartition class?
Jéjé - 15 Mar 2006 00:44 GMT
try the parrallel process utility.

> Hi,
>
[quoted text clipped - 14 lines]
> properties
> of the clsPartition class?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.