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]

... 46  47  48  49  50  51  52  53  54  55  56  [57]  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
1241(non...3/22/201421103(글쓴이의 요청으로 삭제합니다.) [4]
1240이석주3/21/201423761인터넷 익스플로러가 hang이 걸리는 현상 문의 [1]파일 다운로드1
1238(non...3/13/201417677(글쓴이의 요청으로 삭제합니다.) [2]
1237(non...3/11/201417723(글쓴이의 요청으로 삭제합니다.) [2]
1236(non...3/11/201418564(글쓴이의 요청으로 삭제합니다.) [2]
1235(non...3/10/201417662(글쓴이의 요청으로 삭제합니다.) [2]
1234(non...3/10/201420792(글쓴이의 요청으로 삭제합니다.) [3]
1233(non...3/9/201418514(글쓴이의 요청으로 삭제합니다.) [4]
1232(non...3/8/201417420(글쓴이의 요청으로 삭제합니다.) [2]
1231(non...3/7/201418712(글쓴이의 요청으로 삭제합니다.) [9]
1230POCO3/7/201419063쓰레드 안에서 DependencyProperty get, set시 또 다른 스레드 오류.. [1]
1229(non...3/6/201419721(글쓴이의 요청으로 삭제합니다.) [11]
1228POCO3/6/201417753안녕하세요. 질문이 있습니다. [1]
1226김형진3/4/201427889안녕하세요 windows azure에 관해 질문했던 사람입니다. [2]
1224(non...3/3/201423241(글쓴이의 요청으로 삭제합니다.) [11]
1223sadf...3/3/201417755아래 질문에 답변 감사드립니다. 한가지 더 궁금한점이 있어 질문드립니다. [1]
1222(non...3/2/201418205(글쓴이의 요청으로 삭제합니다.) [4]
1221(non...3/1/201418638(글쓴이의 요청으로 삭제합니다.) [2]
1220Until2/28/201416937질문드립니다. [1]
1219이성환2/28/201416377string.Join()과 Enumerable.Aggregate()의 차이가 궁금합니다. [2]파일 다운로드1
1218김형진2/25/201418241안녕하세요. window azure에 대해서 질문이 있어서 문의 드립니다 [4]
1217(non...2/23/201418829(글쓴이의 요청으로 삭제합니다.) [1]
1215아리수2/20/201422273C# 공부하면서 WPF에 대한 질문. [2]
1214조광훈2/20/201420282IIS8 응용프로그램 풀 관련 질문 드립니다. [2]파일 다운로드1
1213김태훈2/17/201417460가상화 프로그램 질문입니다. [1]파일 다운로드1
1212조광훈2/13/201416250ISAPI 필터에서 커스텀 헤더 정보 추가 [1]파일 다운로드1
... 46  47  48  49  50  51  52  53  54  55  56  [57]  58  59  60  ...