473,386 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

COM+, CRM's and Stuff

Two questions:

1) I have an VB.NET application that moves files, loads them in DTS, and
updates a custom SQL database queue. I want to move everything into COM+ to
be XA compliant. I built the MSDN bank sample, and adding SQL support and
an interface, and it is a very cool sample (answered a lot of questions),
but how do I integrate my FSO CRM into the mix? How do I merge these two
worlds?

2) The application is multi-threaded, will it continue to work well in a
transactional environment. I read something about Queueing, and I don't
want to have a bottleneck when I am loading files in a multi-threaded
environment.

Thank very much,

Steve
Nov 21 '05 #1
5 1708
Here is the code I have so far, I am getting COM errors, and other
Exceptions:

Imports System

Imports System.IO

Imports System.Reflection

Imports System.EnterpriseServices

Imports System.Runtime.Serialization

Imports System.EnterpriseServices.CompensatingResourceMana ger

Public Enum iStatus

None

Posting

Posted

Completed

InsufficientFunds

Failed

Exception

COMException

UnknownError

End Enum

Public Interface iaRecord

Function ToString() As String

End Interface

<Serializable()> _

Public Class aRecord

Implements iaRecord

Public Shared StartPath As String

Public Shared EndPath As String

Public Shared AppScope As Integer

Public Sub New(ByVal a As Integer, ByVal s As String, ByVal e As String)

AppScope = a

StartPath = s

EndPath = e

End Sub

Public Overrides Function ToString() As String Implements iaRecord.ToString

Return AppScope & ":" & StartPath & ":" & EndPath

End Function

End Class

Public Interface iCrmWorker

Function MoveFile(ByVal AppScope As Integer, ByVal StartPath As String,
ByVal EndPath As String) As iStatus

End Interface

<Transaction(TransactionOption.Required)> _

Public Class FSOCRM

Inherits ServicedComponent

Implements iCrmWorker

Public _ex As Exception = Nothing

Public _msg As String = "Started"

Public Function MoveFile(ByVal AppScope As Integer, ByVal StartPath As
String, ByVal EndPath As String) As iStatus Implements iCrmWorker.MoveFile

Try

_msg = "Creating Clerk"

Dim myclerk As Clerk = New Clerk(GetType(CRMCompensator), "CRMCompensator",
CompensatorOptions.AllPhases)

_msg = "Creating new aRecord"

Dim _aRecord As New aRecord(AppScope, StartPath, EndPath)

_msg = "Writing Log Record"

myclerk.WriteLogRecord(_aRecord.ToString)

_msg = "Forcing Log"

myclerk.ForceLog()

_msg = "Getting FileInfo"

Dim fInfo As New FileInfo(StartPath)

_msg = "Moving File"

fInfo.MoveTo(EndPath)

_msg = "Done"

'TODO - DO SQL STUFF HERE TO MARK AS MOVED, SHOULD BE TRANSACTIONAL BY
NATURE

ContextUtil.SetComplete()

Return iStatus.Completed

Catch ex As Runtime.InteropServices.COMException

Me._ex = ex

Debug.WriteLine("##COMexception: " & ex.ToString)

ContextUtil.SetAbort()

Return iStatus.COMException

Catch ex As Exception

Me._ex = ex

Debug.WriteLine("##exception: " & ex.ToString)

ContextUtil.SetAbort()

Return iStatus.Exception

Catch

Debug.WriteLine("##unknown error")

ContextUtil.SetAbort()

Return iStatus.UnknownError

End Try

End Function

End Class

Public Interface iCRMCompensator

Sub BeginPrepare()

Function PrepareRecord(ByVal rec As LogRecord) As Boolean

Function EndPrepare() As Boolean

Sub BeginCommit(ByVal fRecovery As Boolean)

Function CommitRecord(ByVal rec As LogRecord) As Boolean

Sub EndCommit()

Sub BeginAbort(ByVal fRecovery As Boolean)

Function AbortRecord(ByVal rec As LogRecord) As Boolean

Sub EndAbort()

Function RecFromString(ByVal s As String) As aRecord

End Interface

Public Class CRMCompensator

Inherits Compensator

Implements iCRMCompensator

Dim bBeginPrepareCalled As Boolean = False

Dim bPrepareRecordCalled As Boolean = False

Dim bBeginCommitCalled As Boolean = False

Dim bCommitRecordCalled As Boolean = False

Dim bBeginAbortCalled As Boolean = False

Dim bAbortRecordCalled As Boolean = False

Dim StartPath As String

Dim EndPath As String

Public Overrides Sub BeginPrepare() Implements iCRMCompensator.BeginPrepare

bBeginPrepareCalled = True

End Sub

Public Overrides Function PrepareRecord(ByVal rec As LogRecord) As Boolean
Implements iCRMCompensator.PrepareRecord

Dim _aRecord As aRecord = RecFromString(rec.ToString)

Debug.WriteLine("prepare: " & _aRecord.ToString)

StartPath = _aRecord.StartPath

EndPath = _aRecord.EndPath

bPrepareRecordCalled = True

Return False

End Function

Public Overrides Function EndPrepare() As Boolean Implements
iCRMCompensator.EndPrepare

If Not bBeginPrepareCalled Then Return False

If Not bPrepareRecordCalled Then Return False

If StartPath = "" Or EndPath = "" Then Return False

Return True

End Function

Public Overrides Sub BeginCommit(ByVal fRecovery As Boolean) Implements
iCRMCompensator.BeginCommit

bBeginCommitCalled = True

End Sub

Public Overrides Function CommitRecord(ByVal rec As LogRecord) As Boolean
Implements iCRMCompensator.CommitRecord

Dim o As aRecord = RecFromString(rec.ToString)

Dim fInfo As New FileInfo(o.StartPath)

fInfo.MoveTo(o.EndPath)

bCommitRecordCalled = True

Return True

End Function

Public Overrides Sub EndCommit() Implements iCRMCompensator.EndCommit

If Not bBeginCommitCalled Then Return

If Not bCommitRecordCalled Then Return

If StartPath = "" Or EndPath = "" Then Return

End Sub

Public Overrides Sub BeginAbort(ByVal fRecovery As Boolean) Implements
iCRMCompensator.BeginAbort

bBeginAbortCalled = True

End Sub

Public Overrides Function AbortRecord(ByVal rec As LogRecord) As Boolean
Implements iCRMCompensator.AbortRecord

bAbortRecordCalled = True

Dim _aRecord As aRecord = RecFromString(rec.ToString)

Debug.WriteLine("abort: " & _aRecord.ToString)

StartPath = _aRecord.StartPath

EndPath = _aRecord.EndPath

Dim fInfo As New FileInfo(EndPath)

fInfo.MoveTo(StartPath)

Return True

End Function

Public Overrides Sub EndAbort() Implements iCRMCompensator.EndAbort

If Not bBeginAbortCalled Then Return

If Not bAbortRecordCalled Then Return

If StartPath = "" Or EndPath = "" Then Return

End Sub

Public Function RecFromString(ByVal s As String) As aRecord Implements
iCRMCompensator.RecFromString

Dim newS() As String = s.Split(":"c)

Dim _aRecord As New aRecord(CInt(newS(0)), newS(1), newS(2))

Return _aRecord

End Function

End Class
In the Event Viewer, I get the following error(s):

The system has called the CRM Compensator custom component and that
component has returned an error. This indicates a problem with the CRM
Compensator component. Notify the developer of the CRM Compensator component
that this failure has occurred.

Component Prog ID: {37c543e9-bf6b-35ed-977c-f2ecf976fbd0}

Method Name: ICrmCompensator::AbortRecord

Server Application ID: {607E9757-6D53-4D82-9E70-9E88BB27D113}

Server Application Instance ID:

{1A1BBF99-9B4F-4A11-8C41-76B6E01BFB95}

Server Application Name: BankComponent

The serious nature of this error has caused the process to terminate.

Error Code = 0x80004002 : No such interface supported

COM+ Services Internals Information:

File: d:\nt\com\complus\src\comsvcs\crm\crmclerkobj.cpp, Line: 3578

Comsvcs.dll file version: ENU 2001.12.4720.130 shp

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Of course, being that it uses reflection to call the COM+ app, I can't debug
to see where the error is, and the referenced .cpp file doesn't exist in
that path.

Any thoughts on if there is something I am doing wrong, or how to further
debug it?

"platinumbay" <pl*********@community.nospam> wrote in message
news:#d**************@TK2MSFTNGP12.phx.gbl...
Two questions:

1) I have an VB.NET application that moves files, loads them in DTS, and
updates a custom SQL database queue. I want to move everything into COM+ to be XA compliant. I built the MSDN bank sample, and adding SQL support and
an interface, and it is a very cool sample (answered a lot of questions),
but how do I integrate my FSO CRM into the mix? How do I merge these two
worlds?

2) The application is multi-threaded, will it continue to work well in a
transactional environment. I read something about Queueing, and I don't
want to have a bottleneck when I am loading files in a multi-threaded
environment.

Thank very much,

Steve

Nov 21 '05 #2
Hi,

Currently I am contacting related person who could help you on it. We will
reply here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #3
It is hard to tell the reason for the CRM error by just looking at the
eventlog error. We need more information. We need a Reproducible code to
further troubleshoot this issue.
- service code (I assume it is the linked VB.Net) (bits, symbol).
- installation script.
- client codes (bits, symbol).

BTW, we scan thru the code and like to give the following suggestion.
- the aRecord class member (startpath, ...) should not be shared.
- don't need to do tostring on LogRecord. Client can get the object
directly by record.Record. We will serialize that for you.
thanks,
Lalitha
Microsoft COM+ Developer Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4
It is hard to tell the reason for the CRM error by just looking at the
eventlog error. We need more information. We need a Reproducible code to
further troubleshoot this issue.
- service code (I assume it is the linked VB.Net) (bits, symbol).
- installation script.
- client codes (bits, symbol).

BTW, we scan thru the code and like to give the following suggestion.
- the aRecord class member (startpath, ...) should not be shared.
- don't need to do tostring on LogRecord. Client can get the object
directly by record.Record. We will serialize that for you.
thanks,
Lalitha
Microsoft COM+ Developer Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5
Hi Steve,

Is there any further question on this issue? If so, please feel free to let
us know.

Thanks,

Luke

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DraguVaso | last post by:
Hi, I need to make an application that does basicly this: - Receiving Demands from Clients for some Products - Searching in the DataBase which Suppliers (may) have these Products - Contacting...
0
by: Jay Mehta | last post by:
This is a Microsoft CRM related question more than it is a C# question. However, I can't find a MS CRM newsgroup, so if any of you can help me, don't feel shy!! I can't find...
5
by: Phil Adams | last post by:
Hi Peeps, I am trying to do some custom programming for CRM, but alas i am only a classic asp programmer. Can someone help me by translating this into asp.net in VB instead of C#, i can then get...
0
by: JT_74 | last post by:
I'm developing an add-on module for CRM. I was not the person who installed CRM on our server, but I believe it goes along with the problem I'm having. I think it's more of an ASP.NET question then...
0
by: platinumbay | last post by:
Two questions: 1) I have an VB.NET application that moves files, loads them in DTS, and updates a custom SQL database queue. I want to move everything into COM+ to be XA compliant. I built the...
3
by: Eric van der Niet | last post by:
I have thuis webservice. Used to get account information out of microsoft crm. But is reply's an error! can someone see whats the error in this code???? Help! using System; using...
1
by: rajanipro | last post by:
Hi! I have been assigned to develop a CRM (Customer Relationship Management) Web application using the following: Visual Studio 2005, C# 2.0, ASP .NET 2.0, and SQL Server 2005. What are the dos...
0
by: www.cvpages.com | last post by:
JOB SEEKERS! You want to WORK with the Finest Employers in USA,UK,CANADA,Asia Pacific & Worldwide. Just look no further.Your search Ends here. Just choose your specialisation from the JOB...
5
by: edwardwill | last post by:
My client has a mission-critical application that was written in Microsoft Access sitting on a SQL Server database. It is basically a Quotation management system. The client wishes to install CRM...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.