Wednesday, February 22, 2006
I Already Have MARS in SQL 2000
Can we really have Mars in SQL 2000 ? The answer is yes to some limit
pIDBCreateCommand->CreateCommand(NULL, IID_ICommandText, (IUnknown**)
&pICommandText);
pIDBCreateCommand->CreateCommand(NULL, IID_ICommandText, (IUnknown**)
&pICommandText2);
pICommandText->SetCommandText(DBGUID_DBSQL,
OLESTR("select operation_id, operation_code, product_id, quantity
from dbo.operations where processed=0"));
pICommandText2->SetCommandText(DBGUID_DBSQL,OLESTR("update dbo.operations
set processed=1 where operation_id=?"));
//Execute the command
pICommandText->Execute(NULL, IID_IRowset, NULL, &cRowsAffected, (IUnknown**)
&pIRowset);
..
ProcessOperation();
..
//Execute the command 2
pICommandText2->Execute(NULL, IID_IRowset, NULL, &cRowsAffected, NULL);
What does SQLOLEDB does in the background ? It opens a new connection . What
? Yes you heard me . It opens a new connection and execute command2
Some Scenarios :
1- what happens if command1 was in a DTC TX ?
in this case SQLOLEDB cannot open a new connection and command2
fails
2-Command1 in a TSQL TX not a DTC TX ?
SQLOLEDB has no idea that command1 is in a TX and it will open a new
one, ending in two command living in different TX.
3- think about more scenarios like locking (2 commands lock each other )
There are a lot of more scenarios to be covered but no time
Any way , again the answer of the question is YES of course we do support
MARS in SQL 2000 behind the scene
Tuesday, February 21, 2006
The binding handle is invalid
At last I found a solution for this problem .
Problem : when you start debuggin on Visual Studio 2005 you get this
message . Some people disable generating the vshost files which are
important
But the solution is : go to the terminal services windows service and
change the startup option to be manual and restart the computer or make
it manual and start it without starting the computer
Sunday, February 19, 2006
Change configuration profile in 2005
If you want to change the configuration Profile from Debug to Release in
2005 , some people go to application properties designer and from (Compile
or Build) they change the configuration to Debug or Release . This is wrong
This allows you only to change the settings of each profile , but if you
want to change the current running active profile you have to go to menu
Build\Configuration Manager and change it
Saturday, February 18, 2006
vshost
What are vshost files : "app.vshost.exe" and "app.vshost.exe.config" ?
Vshost files are used at design time only and they are used for 3 purposes :
* improved F5 performance. Keep the state of appdomains between runs
of my application. So before running the app for 2nd time , the vshost
preserve the state of appdomain so saving sometime to reinitialize
everything
* partial trust debugging
* design time expression evaluation. Which has taken out from VB2003
and now is back for all langs .you can use the immediate windows in design
mode for some design time expressions evaluation we need,