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]

... 31  32  [33]  34  35  36  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
5074진우10/28/201814119C# 생성과 동시에 초기화 하는 코드 문의 [2]
5073돌고래10/27/201814174c# 공부 방향 질문 드립니다. [3]
5072엔벌잉10/24/201814310C# textbox, button질문입니다! [4]파일 다운로드1
5071엔벌잉10/23/201815318C#윈도우폼 질문입니다!! [2]
5070진우10/17/201815234Visual Studio 서비스팩과 업데이트 차이 문의 [2]
5069감자10/12/201816062빌드 구성을 재설정하는 방법이 있을까요? [1]파일 다운로드1
5068누오10/10/201814727ASP Core 2.0 에서 dll안에 있는 뷰 읽어들이는 방법? [1]
5067김정민10/5/201814919다른 윈도우가 깨지는 현상을 막을 수 있을까요 [3]
5066로니브10/4/201815686ASP.NET MVC에서 View 파일 숨기는법? 보안처리 하는법? 관련 질문.. [1]
5065키모10/1/201817157문자 질문입니다. [3]
5064로니브10/1/201816533클래스 라이브러리에서 .cshtml파일을 추가하는 방법은 없나요? [3]
5063진우9/28/201815342ADO.net 과 Entity Framework 차이 문의 [2]
5062테스트9/27/201815842C# import file 의 구조체 배열 선언 및 호출에 대해 문의. [3]
5061안녕하세요9/13/201816088c# 프로그래밍 관련 문의 [1]
5060임민재9/8/201815131c# install 파일 생성 시 문제가 발생하였습니다 [1]파일 다운로드1
50599/7/201814596Winform TextBox 포커스 유지하는 방법 질문 [파일첨부] [1]파일 다운로드1
50589/5/201818886Winform TextBox 포커스 유지하는 방법 질문 [3]
5056박종윤8/30/201817596c# dll을 C++에서 사용 시 event 호출 [4]파일 다운로드1
5055초보자8/29/201816661asp.net 에서 다른 서버의 iis를 stop하는 batch file을 실행시키는데 동작하지 않습니다. [5]
5054사도신8/29/201815126[wpf] textbox insert overite 모드시에 [4]파일 다운로드1
5053엿장수8/26/201814216directshow filter 에서의 IMediaSample 의 시간에대한질문입니다 [1]
5052오명현8/26/201814744Tcp소켓 실습 Exeption 도와주세요! [4]파일 다운로드1
5049오명현8/23/201814275책 477페이지 내용 중 이해가 안가는 부분이 있어 질문드립니다. [1]
5048오명현8/23/201813959포트 관련 질문 하나더 있습니다. [1]
5047오명현8/22/201814725포트가 없을 경우를 가정한 내용에 대해 질문이 있습니다. 책468p. [1]
5046엿장수8/22/201814619다이렉트쇼 필터 추가하는데 [2]
... 31  32  [33]  34  35  36  37  38  39  40  41  42  43  44  45  ...