Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Select the transaction isolation level and timeout in a serviced component

Total Hit ( 2948)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Writing a transactional COM+ component with VB.NET is as simple as applying the Transaction attribute to a class that inherits from System.EnterpriseServices.ServicedComponent:

Click here to copy the following block
Imports System.EnterpriseServices

< Transaction()> Public Class BankTransfer
  Inherits ServicedComponent
  ' ...
End Class

If you don't pass any argument to the attribute's constructor, the class is marked as requiring a transaction. You can explicitly set the transaction behavior by passing a TransactionOption enumerated value, which can be Disabled, NotSupported, Supported, Required, and RequiresNew:

Click here to copy the following block
< Transaction( TransactionOption.RequiresNew )>

Even more interesting, you can set the isolation level for the transaction being used, by setting the Isolation property, which in turn can take a TransactionIsolationLevel enumerated value (Any, ReadUncommitted, ReadCommitted, RepeatableRead, or Serializable), and even set the transaction timeout by setting the Timeout property, if you want to override the global timeout value:

Click here to copy the following block
< Transaction( TransactionOption.RequiresNew, _
  Isolation:=TransactionIsolationLevel.Repeatable, Timeout:=10 )>


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.