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]

... 76  [77]  78  79  80  81  82  83  84  85  86  87  88  89  90  ...
NoWriterDateCnt.TitleFile(s)
594ygso...3/13/200714191ClickOnce를 이용하여 SmartClient를 배포할경우.. [2]
589김희택3/2/200713321리소스 추가 방법에 대한 아티클을 보던중에 질문요... [1]파일 다운로드1
588이성진2/24/200715615웹 -> 스마트클라이언트 -> 웹서비스 의 세션 공유 방법 ? [1]
583김영민2/22/200713785Vista에서 "관리자 권한으로 실행"을 통해 실행한 프로세스의 동작
584정성태2/22/200715295    답변글 [답변]: Vista에서 "관리자 권한으로 실행"을 통해 실행한 프로세스의 동작
582한귀순2/22/200713830sqlhelper 의 updatedataset
585정성태2/23/200713092    답변글 [답변]: sqlhelper 의 updatedataset [1]
579futu...2/16/200714605VS2005의 스마트 클라이언트에서 웹브라우저 예제 질문입니다. [1]
578정해봉2/16/200713838IE Embeded Assambly 방식에서 CAS 설정 방법 [1]
575박성민2/12/200714605COM에 데이터 보내기 질문입니다. [1]
571엔틱스2/7/200715300그냥... 질문은 아닙니다만... [2]
5682/6/200712555이런 오류 화면을 어떻게 찾아봐야 - 알아봐야 - 하는지요?파일 다운로드1
569정성태2/6/200714036    답변글 [답변]: 이런 오류 화면을 어떻게 찾아봐야 - 알아봐야 - 하는지요? [1]
570정성태2/6/200713955        답변글 [답변]: [답변]: 이런 오류 화면을 어떻게 찾아봐야 - 알아봐야 - 하는지요?
5732/8/200712929            답변글 [답변]: [답변]: [답변]: 이런 오류 화면을 어떻게 찾아봐야 - 알아봐야 - 하는지요? [1]파일 다운로드1
565한귀순2/5/200713506typed dataset 의 유용성
566정성태2/6/200715287    답변글 [답변]: typed dataset의 유용성 [1]
564정민영2/5/200713730혹시 이런 경우 보신적 있으신가 궁금합니다..^^; [2]
563창민이2/2/200713910Visual C++ COM Objects Returning Recordsets 사용에 대해.. [3]
562현석1/29/200713898C# 스마트응용장치에서 아이콘 움직이게하는거 질문요 ^^ [1]파일 다운로드1
559초보1/27/200715210급 질문 입니다. visual studio 자동 종료에 대한 질문입니다. [2]
558즈믄1/26/200714920.Net Framework v2.0에서 Winform의 Panel에 Excel파일 보여주기 [2]
556정재우1/26/200714989vista에서 smartclient의 System.Security.PermissionsRegistryPermission 에러 [1]
555dev....1/25/2007163702005 WebBrowser내에서 팝업 처리 문제 관련 질문입니다.
561정성태1/29/200719212    답변글 [답변]: 2005 WebBrowser 내에서 팝업 처리 문제 관련 질문입니다.
554sky1/23/200714988<급질문> interop 를 사용함에 있어 [2]
... 76  [77]  78  79  80  81  82  83  84  85  86  87  88  89  90  ...