Showing posts with label suppose. Show all posts
Showing posts with label suppose. Show all posts

Monday, March 26, 2012

IExtension.SetConfiguration not working

I am having

problems with the method IExtension.SetConfiguration in my Custom Data Extension.

According to MSDN

I am suppose to add <Configuration> tags in my config file, however this does not work for me.

The configuration string stays empty.

(http://msdn2.microsoft.com/en-us/library/microsoft.reportingservices.interfaces.iextension.setconfiguration.aspx)

This is an example of my comfig file:

<Extension

Name="Teradata" Type="namespace.path.to.connect,assemly.path.to.DLL">

<Configuration>value</Configuration>

</Extension>

I have also

tried Microsoft's exact example character for character

<Extension

Name="Teradata" Type="namespace.path.to.connect,assemly.path.to.DLL">
<Configuration>

<MyExtensionConfigurationData>

<MyExtensionData1>Value</MyExtensionData1>

<MyExtensionData2>Value</MyExtensionData2>

</MyExtensionConfigurationData>
</Configuration>
</Extension>

My SetConfiguration method

looks like this:

void

IExtension.SetConfiguration(string configuration)

{

string test_string =

configuration;

}

Does anyone see what I am missing?I do not see any additional steps on MSDN

that I missed.

Jason,
Is there a way I can contact you? It seems we are working towards similar issues.

R

IExtension.SetConfiguration not working

I am having

problems with the method IExtension.SetConfiguration in my Custom Data Extension.

According to MSDN

I am suppose to add <Configuration> tags in my config file, however this does not work for me.

The configuration string stays empty.

(http://msdn2.microsoft.com/en-us/library/microsoft.reportingservices.interfaces.iextension.setconfiguration.aspx)

This is an example of my comfig file:

<Extension

Name="Teradata" Type="namespace.path.to.connect,assemly.path.to.DLL">

<Configuration>value</Configuration>

</Extension>

I have also

tried Microsoft's exact example character for character

<Extension

Name="Teradata" Type="namespace.path.to.connect,assemly.path.to.DLL">
<Configuration>

<MyExtensionConfigurationData>

<MyExtensionData1>Value</MyExtensionData1>

<MyExtensionData2>Value</MyExtensionData2>

</MyExtensionConfigurationData>
</Configuration>
</Extension>

My SetConfiguration method

looks like this:

void

IExtension.SetConfiguration(string configuration)

{

string test_string =

configuration;

}

Does anyone see what I am missing?I do not see any additional steps on MSDN

that I missed.

Jason,
Is there a way I can contact you? It seems we are working towards similar issues.

R

Monday, March 19, 2012

Identity sequence of multi-threads insertion

Recently I'm working on a multi-thread solution based on SQL-Server, now I'm facing such a problem:

Suppose I have process No.1(with multi-threads) inserting data to Table A, which has its identity column auto generated. And process No.2(also with multi-threads) retrieving data from Table A ,generate some records and insert the result into Table B. Both of these two processes are doing batch processing(batch retrieving and batch writing), and they are running parallelly.

Now since process No.2 retrieve data sequencely by the identity of Table A, it found there exists missing results. This is due to that records with bigger identities are not necessarily commited earlier than those who have smaller identities.

One direct solution is add one flag field in Table A indicating whether this record has been processed by process No.2, and each time it was processed , the field will be set. But unfortunatelly the table structure is not supposed to be modified.

So is there any other good solutions for this problem? Thanks.

A solution may be that process 1 uses row-level locking when select/update and process 2 use the readpast hint when selecting the records:

READPAST specifies that locked rows be skipped during the read. READPAST only applies

to transactions operating at the default READ COMMITTED isolation level, and will

only read past row-level locks. READPAST can only be used in SELECT statements.

Normal blocking can be worked around by having transactions read past rows being

locked by other transactions.
See the following article: http://www.sql-server-performance.com/rd_table_hints.asp

Else I cannot see any other solution except adding some external data structure to keep track of processing status.|||

Hi carlop, I'm afraid locks won't resolve this issue.

Maybe I should explain my problem more detailly.

Suppose Process No.1 have 3 threads working , and here are the identities generated after the insertion.

thread 0 : 1 , 4, 7

thread 1: 2 , 5, 8

thread 2: 3, 6, 9

And at one time point, thread 0 commited the transaction with 3 rows inserted , whilst Process No.2 is retrieving data from Table A , so only these 3 records were retrieved and processed. So Process No.2 will record "7" as the biggist identity it has processed, and next time it will start processing from identities greater than "7" . So records with identities 2, 5,3,6 are lost if thread 1 and thread 2 commited later.

|||You have to add an external struct that keeps track of the processing jobs. I see no other way.|||You could add another table that is logged to on insert to table A. Process 2 reads these records and deletes them from the new tableonce processed. When it goes back for a second time it reads the nest set to process and then deletes from. You could use Service Broker if you wanted as it has a nice queue mechanism|||

Maybe this is the only solution I think.

Thank you all.

Identity sequence for multithreads insert

Recently I'm working on a multi-thread solution based on SQL-Server, now I'm facing such a problem:

Suppose I have process No.1(with multi-threads) inserting data to Table A, which has its identity column auto generated. And process No.2(also with multi-threads) retrieving data from Table A ,generate some records and insert the result into Table B. Both of these two processes are doing batch processing(batch retrieving and batch writing), and they are running parallelly.

Now since process No.2 retrieve data sequencely by the identity of Table A, it found there exists missing results. This is due to that records with bigger identities are not necessarily commited earlier than those who have smaller identities.

One direct solution is add one flag field in Table A indicating whether this record has been processed by process No.2, and each time it was processed , the field will be set. But unfortunatelly the table structure is not supposed to be modified.

So is there any other good solutions for this problem? Thanks.

A solution may be that process 1 uses row-level locking when select/update and process 2 use the readpast hint when selecting the records:

READPAST specifies that locked rows be skipped during the read. READPAST only applies

to transactions operating at the default READ COMMITTED isolation level, and will

only read past row-level locks. READPAST can only be used in SELECT statements.

Normal blocking can be worked around by having transactions read past rows being

locked by other transactions.
See the following article: http://www.sql-server-performance.com/rd_table_hints.asp

Else I cannot see any other solution except adding some external data structure to keep track of processing status.|||

Hi carlop, I'm afraid locks won't resolve this issue.

Maybe I should explain my problem more detailly.

Suppose Process No.1 have 3 threads working , and here are the identities generated after the insertion.

thread 0 : 1 , 4, 7

thread 1: 2 , 5, 8

thread 2: 3, 6, 9

And at one time point, thread 0 commited the transaction with 3 rows inserted , whilst Process No.2 is retrieving data from Table A , so only these 3 records were retrieved and processed. So Process No.2 will record "7" as the biggist identity it has processed, and next time it will start processing from identities greater than "7" . So records with identities 2, 5,3,6 are lost if thread 1 and thread 2 commited later.

|||You have to add an external struct that keeps track of the processing jobs. I see no other way.|||You could add another table that is logged to on insert to table A. Process 2 reads these records and deletes them from the new tableonce processed. When it goes back for a second time it reads the nest set to process and then deletes from. You could use Service Broker if you wanted as it has a nice queue mechanism|||

Maybe this is the only solution I think.

Thank you all.

Sunday, February 19, 2012

Identity

Suppose I have a table named table1 which has a identity field named "Col1".Now i want to have a backup of this table by running this script
select * into table1_backup from table1
I get the backup in the table table1_backup but i miss the identity property for the field col1.
My question is
1) How can I get the identity property by running that script?
2)How can i have the constraints of table1 in table1_backup?
SubhasishLooks like your trying to make an exact copy of the original table including the identity seed?

To import the identity turn on identity insert like so:

Set IDENTITY_INSERT table1_backup ON
Select * into table1_backup from table1
Set IDENTITY_INSERT table1_backup OFF

Brent|||Thanks Bren.
But what is about my second question?|||Brent
This script will not work
Set IDENTITY_INSERT table1_backup ON
Select * into table1_backup from table1
Set IDENTITY_INSERT table1_backup OFF

Because the table isgetting created in the second stape(Select * into table1_backup from table1)
So before creating the table how can it's IDENTITY_INSERT property set to on or off?
Subhasish|||Sorry bout that, this one should work,, takes awhile longer as you need to define the datatypes for each column such as col1 int, col2 varchar(20)

Create Table table1_backup (col1 col1type, col2 col2type, etc)

Set IDENTITY_INSERT table1_backup ON
Insert into table1_backup (col1, col2, etc)
select col1, col2, etc
from table1
Set IDENTITY_INSERT table1_backup OFF

As for the second question, not sure off the top of my head on importing contraints. I'll look around, but best bet would be to put that question in a new thread here in dbforums.

Brent

Originally posted by subhasishray
Brent
This script will not work
Set IDENTITY_INSERT table1_backup ON
Select * into table1_backup from table1
Set IDENTITY_INSERT table1_backup OFF

Because the table isgetting created in the second stape(Select * into table1_backup from table1)
So before creating the table how can it's IDENTITY_INSERT property set to on or off?
Subhasish

Identity

Suppose we have a table with a column which has a property Is Identity set to true.

Is any programmatic way ( for example, in stored procedure ) to change this property to false?

Hi,

have a look at this article:

http://www.eggheadcafe.com/community/aspnet/9/10005322/remove-the-identity-prope.aspx

--
SvenC