[환경]
- ERWin7.2.5
1. Physical 선택 후, 여백화면에서 오른쪽 마우스 클릭 후 Harden Physical Names 선택
2. Logical 로 변경
3. 메뉴 [Model] - [Domain Dictionary] 후, Name Inherited by Attribute 항목을 "%ColumnsComment" 로 변경
4. 메뉴 [Model] - [Attributes] 선택 후, Reset 클릭, Reset all attributes in model 선택 후 Select Properties to Reset 항목은 Name 만 선택
2013년 9월 15일 일요일
2013년 9월 5일 목요일
c# 에서 Queue 사용
어떤 객체에 대해서, 한 곳에서 처리하기 위해 간단히 Queue 를 사용해 본다
Transaction 이 거시기 한 Cubrid( invalid buffer position 등과 같은 Exception Error ) 에, 짧은 순간 많은 쿼리를 처리 하거나 할 때...
선언
using System.Collections;
public Queue m_sqlQueue = new Queue();
구현
public override bool SQLAdd(string sQuery)
{
try
{
m_sqlQueue.Enqueue(sQuery);
return true;
}
catch (Exception ex)
{
MiddlewareLog.LogDebug(ex);
return false;
}
}
// 아래 예제 스레드는 간단하지만, diffTick 을 20ms 으로 고정하지 않고, 짱구를 좀 굴리면 좀 더 최적화 해서 처리 할 수 있다, 여기선 Pass
private void DoDBApply()
{
try
{
int startTick = Environment.TickCount;
int currTick = 0;
int diffTick = 0;
do
{
System.Threading.Thread.Sleep(1);
if (bShutdown == true) break;
currTick = Environment.TickCount;
diffTick = currTick - startTick;
if (diffTick > 20)
{
startTick = Environment.TickCount;
diffTick = 0;
if (m_sqlQueue.Count > 0)
{
object str = m_sqlQueue.Dequeue();
QueryExecute((string)str);
}
}
} while (bShutdown == false);
}
catch
{
}
}
Transaction 이 거시기 한 Cubrid( invalid buffer position 등과 같은 Exception Error ) 에, 짧은 순간 많은 쿼리를 처리 하거나 할 때...
선언
using System.Collections;
public Queue m_sqlQueue = new Queue();
구현
public override bool SQLAdd(string sQuery)
{
try
{
m_sqlQueue.Enqueue(sQuery);
return true;
}
catch (Exception ex)
{
MiddlewareLog.LogDebug(ex);
return false;
}
}
// 아래 예제 스레드는 간단하지만, diffTick 을 20ms 으로 고정하지 않고, 짱구를 좀 굴리면 좀 더 최적화 해서 처리 할 수 있다, 여기선 Pass
private void DoDBApply()
{
try
{
int startTick = Environment.TickCount;
int currTick = 0;
int diffTick = 0;
do
{
System.Threading.Thread.Sleep(1);
if (bShutdown == true) break;
currTick = Environment.TickCount;
diffTick = currTick - startTick;
if (diffTick > 20)
{
startTick = Environment.TickCount;
diffTick = 0;
if (m_sqlQueue.Count > 0)
{
object str = m_sqlQueue.Dequeue();
QueryExecute((string)str);
}
}
} while (bShutdown == false);
}
catch
{
}
}
2013년 9월 4일 수요일
2013년 9월 3일 화요일
Dictionary 를 Array List 처럼 사용하기
선언
public static Dictionary<string, object> jsonSPDM24n = new Dictionary<string, object>();
할당
두번째 인자인 object 에 다시 같은 형태의 Dictionary<string, object> 를 Add 메소드를 사용하여 추가하거나, Assign 해서 사용 할 수 있다
if (jsonSPDM24n.ContainsKey(json["device_id"].ToString() + "_" + json["addressno"].ToString()) == true)
{
jsonSPDM24n[json["device_id"].ToString() + "_" + json["addressno"].ToString()] = json;
}
else
{
jsonSPDM24n.Add(json["device_id"].ToString() + "_" + json["addressno"].ToString(), json);
}
즉, 아래와 같은 의미가 되겠다
Dictionary<string, Dictionary<string, object>>
사용
이제 이걸 꺼내서 사용하는 것은,
foreach (KeyValuePair<string, object> temp in jsonSPDM24n)
{
Dictionary<string, object> json = (Dictionary<string, object>)temp.Value;
if ((string)json["producttype"] == "spdm24n")
{
....
}
}
public static Dictionary<string, object> jsonSPDM24n = new Dictionary<string, object>();
할당
두번째 인자인 object 에 다시 같은 형태의 Dictionary<string, object> 를 Add 메소드를 사용하여 추가하거나, Assign 해서 사용 할 수 있다
if (jsonSPDM24n.ContainsKey(json["device_id"].ToString() + "_" + json["addressno"].ToString()) == true)
{
jsonSPDM24n[json["device_id"].ToString() + "_" + json["addressno"].ToString()] = json;
}
else
{
jsonSPDM24n.Add(json["device_id"].ToString() + "_" + json["addressno"].ToString(), json);
}
즉, 아래와 같은 의미가 되겠다
Dictionary<string, Dictionary<string, object>>
사용
이제 이걸 꺼내서 사용하는 것은,
foreach (KeyValuePair<string, object> temp in jsonSPDM24n)
{
Dictionary<string, object> json = (Dictionary<string, object>)temp.Value;
if ((string)json["producttype"] == "spdm24n")
{
....
}
}
2013년 8월 28일 수요일
Oracle 의 (+) 사용
- Outer join 에 사용 된다 ( 조건을 만족하지 않는 행도 반환 )
- Left Outer Join : 왼편 테이블에 행이 없어도 반환
SELECT T1.A, T2.B
FROM TABLE1 T1, TABLE2 T2
WHERE T1.C(+) = T2.C
- Right Outer Join : 오른편 테이블에 행이 없어도 반환
SELECT T1.A, T2.B
FROM TABLE1 T1, TABLE2 T2
WHERE T1.C = T2.C(+)
- Left Outer Join : 왼편 테이블에 행이 없어도 반환
SELECT T1.A, T2.B
FROM TABLE1 T1, TABLE2 T2
WHERE T1.C(+) = T2.C
- Right Outer Join : 오른편 테이블에 행이 없어도 반환
SELECT T1.A, T2.B
FROM TABLE1 T1, TABLE2 T2
WHERE T1.C = T2.C(+)
2013년 8월 27일 화요일
asp.net 개발 시 iis 설치 옵션
환경
- WIndows7 64bit
- Visual Studio 2012
설치
- 제어판 - 프로그램 및 기능 - Windows 기능 사용/사용 안함
- 기본 적으로 위의 환경 일 경우 IIS7.5 가 설치 되게 된다
- Visual Studio 2012 의 Express IIS 를 사용하더라도 기본적으로 설치 한다 ( 호환성과 권한 문제로 3xx, 4xx, 5xx 대 에러를 무수히 만날 것이다
- WIndows7 64bit
- Visual Studio 2012
설치
- 제어판 - 프로그램 및 기능 - Windows 기능 사용/사용 안함
- 기본 적으로 위의 환경 일 경우 IIS7.5 가 설치 되게 된다
- Visual Studio 2012 의 Express IIS 를 사용하더라도 기본적으로 설치 한다 ( 호환성과 권한 문제로 3xx, 4xx, 5xx 대 에러를 무수히 만날 것이다
2013년 8월 22일 목요일
피드 구독하기:
글 (Atom)
