Microsoft MVP성태의 닷넷 이야기
글쓴 사람
[손님] (develtop at empal.com)
홈페이지
첨부 파일
[Test.rar]    


구조는 이렇습니다...

지금 현재는 ASP.NET --> 웹서비스(SQL 작성) --> com+ 호출 구조입니다.


<ASP.NET>
        Dim oDataSet As New DataSet()
        Dim oDAL As New ZAA010T()

        fnQuery = ""

        Try
            fnQuery = oDAL.GetZaa010T(sMajorCd, sCodeName, oDataSet) ---> 웹서비스 호출
            If fnQuery <> "" Then Throw New Exception(fnQuery)

            rptSheet1.DataSource = oDataSet
            rptSheet1.DataBind()

        Catch err As Exception
            fnQuery = "[fnQuery]" & vbCrLf & err.Source & vbCrLf & err.Message & vbCrLf & fnQuery
        Finally
            If Not oDataSet Is Nothing Then
                oDataSet.Dispose()
                oDataSet = Nothing
            End If

            oDAL.Dispose()
            oDAL = Nothing
        End Try

======================================================================================================
<웹서비스>
        Dim oDAL As New FSBCtrlWeb.CInvoke()
        Dim sSQL As New StringBuilder("")

        SetZaa010T = ""

        Try

            sSQL.Remove(0, sSQL.Length)

            sSQL.AppendLine("INSERT INTO ZAA010T(MAJOR_CD, MINOR_CD, CODE_NAME, REF_CD1, REF_CD2, REF_CD3) VALUES ( ")
            sSQL.AppendLine(" '" & sMajorCd & "',")
            sSQL.AppendLine(" '" & sMinorCd & "',")
            sSQL.AppendLine(" '" & sCodeName & "',")
            sSQL.AppendLine(" '" & sRefCd1 & "',")
            sSQL.AppendLine(" '" & sRefCd2 & "',")
            sSQL.AppendLine(" '" & sRefCd3 & "') ")

            SetZaa010T = oDAL.ExecuteSQL(sSQL.ToString) ---> com+ 호출
            If Not SetZaa010T.Equals("") Then Throw New Exception(SetZaa010T)


        Catch err As Exception

            SetZaa010T = err.Source & vbCrLf & err.Message & vbCrLf & SetZaa010T

        Finally

            oDAL.Dispose()
            oDAL = Nothing
            sSQL = Nothing

        End Try
================================================================================
<com+>
        [AutoComplete]
        public string ExecuteSQL(string sSQL)
        {
            string rtnVal = "";

            FSBCtrlWeb.Tx oDAL = new FSBCtrlWeb.Tx();

            try
            {
                rtnVal = oDAL.ExecuteSQL(sSQL); ---> sql 실행 함수 호출
                if (rtnVal != "") throw new Exception(rtnVal);
-------- 오류발생
                StringBuilder sSQL2 = new StringBuilder("");

                sSQL2.Remove(0, sSQL.Length);

                sSQL2.AppendLine("INSERT INTO ZAA010T(MAJOR_CD, MINOR_CD, CODE_NAME, REF_CD1, REF_CD2, REF_CD3) VALUES ( ");
                sSQL2.AppendLine(" '88',");
                sSQL2.AppendLine(" '88',");
                sSQL2.AppendLine(" '88',");
                sSQL2.AppendLine(" '88',");
                sSQL2.AppendLine(" '88',");
                sSQL2.AppendLine(" '88') ");

                rtnVal = oDAL.ExecuteSQL(sSQL2.ToString());
                if (rtnVal != "") throw new Exception(rtnVal);
-------
                ContextUtil.SetComplete();
                return "";
            }
            catch(Exception err)
            {
                ContextUtil.SetAbort();
                return err.Source + "\n" + err.Message + "\n" + rtnVal;
            }
            finally
            {
                
            }
        }
================================================================================
< SQL 실행함수>
        [AutoComplete]
        public string ExecuteSQL(string sSQL)
        {
            OracleConnection oConn = null;
            OracleCommand oComm = null;
            int sRtnVal = 0;

            try
            {
                oConn = new OracleConnection(GetConnString());
                oConn.Open();

                oComm = new OracleCommand(sSQL, oConn);

                sRtnVal = oComm.ExecuteNonQuery();

                return "";
            }
            catch (Exception err)
            {
                return err.Source + "\n" + err.Message;
            }
            finally
            {
                oComm.Dispose();
                oComm = null;

                if (oConn != null && oConn.State != ConnectionState.Closed)
                {
                    oConn.Close();
                }
            }
        }


================================================================================

위와 같은 구조로 되어 있는데...요는

com+ 에서 하나의 함수에서 SetComplete 혹은 SetAbort 를 하는데....

SQL 을 하나만 실행한다는 보장이 없거든여.....하나의 함수에서 INSERT , UPDATE, SELECT 등 여러개의 문장이 있을 수 있는데...

그래서 SQL을 실행만을 전담하는 com+(?) 을 따로 만들어서 사용하고 싶은데....

    [Transaction(TransactionOption.Required, Isolation = TransactionIsolationLevel.ReadCommitted), JustInTimeActivation(true),
 EventTrackingEnabled(true)] 와 같은 속성을 어떻게 설정을 해야 하는지요?


예를 들어...

SELECT 만을 실행하는 함수가 GetRecordset, insert, update 등을 실행하는 함수가 ExecuteSQL 로 가정하면...


임의함수 COM+ aaaa 에서 GetRecordSet, ExecuteSQL 함수를 호출 할 경우 트랜잭션이 함께 묶이는지요?

그런 구조를 만들고 싶은데....조언 좀 부탁합니다...


ps. 이야기가 잘 전달이 되었는지...








[최초 등록일: ]
[최종 수정일: 9/21/2006]


비밀번호

댓글 작성자
 



2006-09-25 09시02분
그런 고민을 해결하기 위해 만든 것이 바로,,, 저희 DxFramework 입니다. 현재, DxFramework Lite 버전이 MS 를 통해서 무료로 공개되어 있으니 그것을 다운로드 받으셔서 예제를 참고하십시오.

.NET 표준개발 가이드와 Microsoft.Framework 공개
; http://www.microsoft.com/Korea/MSDN/netframework/technologyinfo/overview/netdevelopmentguid.aspx

(참고로, COM+ 는 DB 로의 연결을 가로채기 때문에, 트랜잭션 특성을 지정하는 것만으로 트랜잭션이 가능하도록 만들어줍니다.)
kevin25
2006-09-25 10시32분
[[손님]] 조언 감사드립니다.
[guest]

1  2  3  4  5  6  7  8  9  [10]  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
5732kss10/8/202212152c# socket.poll 버그인가요? [2]파일 다운로드1
5731kss10/8/202211444c# socket.poll 버그인가요? [3]
5730김재환10/7/202213148WPF에서 디스플레이 배율이 100%가 아닌 경우, Window의 포지션 정보가 부정확해지는 문제 [2]
5729김기헌10/2/202212257안녕하세요 선생님 뮤텍스 관련 질문 드립니다 [2]
5728김경환9/29/202211998그리드뷰관련마지막질문하나드리겠습니다선생님 [5]파일 다운로드1
5727김경환9/26/202211605c# 윈폼 tcp/ip 기반 데이터그리드뷰질문하나드리겟습니다 [3]
5726양승조 donator9/22/202212557C# dll 과 C++ 간 배열 전달. SafeArray [10]파일 다운로드1
5725김기헌9/21/202211087안녕하세요 선생님 윈폼 컨트롤 Dispose 관련 질문드립니다 [2]
5724감사합니...9/19/202211452스레드와 스레드 안전한 객체 사용관련 문의드립니다. [5]
5723드리렁9/13/202211020Pinned Object에 대해서 질문이 있습니다. [2]
5722김인태9/8/202211603대화상자에서 alt + tab 후킹 작업 [1]
5721우종9/7/202210959C++ DLL 과 C# 연동 문의 [2]
5720한예지 donator9/6/202210665학습 방법 질문 있습니다. [7]
5719김경한9/6/202211174안녕하세요 질문하나만드리겠습니다...! [10]
5718김민아9/2/202210968안녕하세요 생성자 호출 시 초기화 순서 질문드립니다 [2]
5716iili...8/26/202211216WinDbg 커널 디버깅에서의 thread freeze [2]
5715에릭8/19/202212279WMI 쿼리 결과값이 Windows Service와 Console 출력에서 상이한 이유가 있을까요? [9]파일 다운로드1
5714허니빠8/18/202211960.net6 hint path 를 프로젝트 단위로 지정할 수 있는 방법을 알고싶습니다 [8]
5713김기헌8/17/202211500안녕하세요 rgb 계산 오차가 있는데 원인을 모르겠습니다.. [3]
5712하태8/17/202211478안녕하세요 background service에서 user32dll 접근 질문 드리겠습니다.! [2]
5711하태8/16/202210752안녕하세요! 윈도우즈 해상도 관련 질문 드립니다. [1]
5710장성욱8/12/202210823c# 시리얼 통신 관련 질문 [3]
5709초보8/12/202210391WPF 커맨드 관련 질문 [2]
5708민성8/11/202211096안녕하세요 c#에서 화면의 배율 및 레이아웃을 변경할려면 어떻게 해야 할까요? [2]파일 다운로드1
5707민성8/10/202210422WPF 엣지 컨트롤에서 화면이 안보이는 현상 [2]파일 다운로드1
5706종규8/7/202213621WPF 에서 SVG 아이콘 사용 방법 문의 [2]
1  2  3  4  5  6  7  8  9  [10]  11  12  13  14  15  ...