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)
5650김기헌4/19/202210594WPF 리소스 관련 질문드립니다 [3]
5649주니어4/15/202210189ffmpeg 질문 있습니다! [2]
5648주니어개...4/13/202210416컴파일된 코드를 원시코드로 바꾸려면 어떻게해야하나요? [1]파일 다운로드1
5647장성욱4/7/202210357코어지정 CPU사용률 관련 질문 [1]
5646서형주4/6/202210583List에 여러개의 class 객체를 만들어 넣을때, 객체의 method들도 같이 생성되어 메모리를 차지하나요? [1]
5645김인태4/6/20229986윈도우즈 서버의 AD 계정 생성 조건이 있을까요? [1]
5644ㅇㅇ4/6/202210955c# 프로그램을 이용하여 리눅스상에 파일 생성이 가능한가요? [1]
5643유필재4/5/202211067TCP클라이언트 연결 및 통신관련하여 문의드려요 [1]
5642차가워4/4/202211468UdpClient 패킷 수신 문의 [4]
5641장성욱4/4/202211378코어 할당 및 cpu 부하테스트 질문 [7]
5640icoo...4/4/202211568웹가든에서 메모리 동적 업데이트 방법 [1]
5639차가워4/4/202211529c++ 서버 c# 클라이언트 호환 문의 [1]
5638초급4/3/202212009c# sql server 연동 [1]
5637따봉이4/1/202212792Winform Form Load 후 자동 캡쳐관련 [1]파일 다운로드1
5636김철순3/31/202212158WPF에서 Richtext의 View 문의 [5]
5635guest3/30/202211526안정적인 pinning이 가능하네요. [3]파일 다운로드1
5633꿀주세요3/30/202211390선생님 마우스 클릭이벤트 질문이 있습니다. [4]
5632김현수3/30/202211851Remote Desktop으로 접속시 WPF UI 가 다시 그려지는 이벤트를 막을 수 없을까요? [3]
5631김기헌3/24/202211433WPF 컨트롤의 그래픽 처리관련 질문드립니다 [2]파일 다운로드1
5630장성욱3/24/202211227로깅관련 질문입니다. [2]
5629감사합니...3/23/202211905함수에서 예외가 발생하면 try ~ catch처리기를 찾을 때 까지 상위 함수로 계속 올라가나요? [2]
5628홍길동3/23/202212725질문드립니다. [2]파일 다운로드1
5626연준혁3/21/202211717안녕하세요. [3]
5625jaew...3/18/202212490c# 8.0 도서를 구입한 사람입니다. [1]
5624초보자3/17/202211358람다 캡처 관련 문의 [2]
5623한예지 donator3/15/202211095인터프리터 원리가 궁금합니다. [4]
1  2  3  4  5  6  7  8  9  10  11  12  [13]  14  15  ...