SlideShare a Scribd company logo
.net webservice for mysql
.NET 에서 MySQL 사용하기
2015.08.29 최진혁
1
2
MSSQL 에서의 in/out
XML type 인자로 받아 프로시져 내부에서 Parsing
3
.NET 의 Reflection 활용 Parameter Bind
Parameter 변경시 매번 코딩은 불편, client – web – database (procedure ) 까지 하나의 class로 관리
4
Information_schema 과다 조회?
CBT 이후 information_schema. ROUTINES 조회에 따른 tmp_table 과다 생성 발견
5
Information_schema 과다 조회?
Check Parameters Option
 Check Parameter = True 시 인자의 개수 와 name 만 맞으면 OK.
순서는 중요하지 않음
 하지만 MySQL Connector 가 해당 parameter binding 을 위해
내부적으로 매번 information schema 조회하면서 tmp table 생성 → 성능저하
 Check Parameter = False 로 하여
Parameter 개수는 물론 순서가 맞지 않을 시에는 Exception 이 발생하도록 하자!
6
Information_schema 과다 조회?
Check Parameters Option
7
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
affect_row vs matched_row
 affect_row : CASE WHEN 절의 조건에 포함되어, 실제 Update 가 일어난 row 수
 matched_row : WHERE 절의 조건을 만족하는 row 수
8
affect_row vs matched_row
SUCCESS Case
FAIL Case
의도한 대로 ROW_COUNT() 가 affected_row 로
집계되어, 체크건수와 실제업데이트건수가 맞지
않은 경우 IF 문에 의해실패 처리됨
(실제 2가지의 rune 모두 업데이트 되지 않음 )
on Workbench Connection
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
9
affect_row vs matched_row
의도한 것과 달리,
IF 문 체크가 되지 않아,
Result 는 0 으로 리턴되고 실제 gold 도 증가함
on MySQL Connector .NET
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
10
Unexpected result on ROW_COUNT()
 Connection String option 에 따라 MySQL .NET Connector 에서 실행한 Procedure 내부의
ROW_COUNT() 가 affected_row 또는 matched_row 로 인식될 수 있음
 Default 는
Use Affected Rows=False
matched_row
해당경우에는 UPDATE 후 ROW_COUNT 체크시 주의해야함.
Use Affected Rows=True
affected_row
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
11

More Related Content

PDF
10장 클래스
PDF
Rails style-guide-2
PPTX
Android binding framework
PPTX
Mvc pattern
PPTX
[스프링 스터디 3일차] @MVC
PDF
MariaDB 마이그레이션 - 네오클로바
PDF
2014-15 Intermediate C++ Study #7
PDF
파이썬 데이터베이스 연결 2탄
10장 클래스
Rails style-guide-2
Android binding framework
Mvc pattern
[스프링 스터디 3일차] @MVC
MariaDB 마이그레이션 - 네오클로바
2014-15 Intermediate C++ Study #7
파이썬 데이터베이스 연결 2탄

Similar to .NET Webservice for MySQL (17)

PDF
[오픈소스컨설팅]Spring MVC
PPTX
Spring mvc
PPTX
ParameterizedTest 와 ContextCaching.pptx
PDF
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
PPTX
프론트엔드스터디 E03 - Javascript intro.
PDF
실전 DataSnap!
PPTX
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스
PDF
07.실행환경 교육교재(표준프레임워크 세부 적용기준)
PPT
Spring MVC
PPTX
파이썬 sqlite 이해하기
PDF
From MSSQL to MariaDB
PDF
04.실행환경 교육교재(화면처리)
PDF
Mvc 패턴
PDF
MySQL/MariaDB Proxy Software Test
PDF
결합도 관점에서 본 VO 문제점
PPTX
MySQL_MariaDB-성능개선-202201.pptx
PPTX
이펙티브 C++ (7~9)
[오픈소스컨설팅]Spring MVC
Spring mvc
ParameterizedTest 와 ContextCaching.pptx
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
프론트엔드스터디 E03 - Javascript intro.
실전 DataSnap!
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스
07.실행환경 교육교재(표준프레임워크 세부 적용기준)
Spring MVC
파이썬 sqlite 이해하기
From MSSQL to MariaDB
04.실행환경 교육교재(화면처리)
Mvc 패턴
MySQL/MariaDB Proxy Software Test
결합도 관점에서 본 VO 문제점
MySQL_MariaDB-성능개선-202201.pptx
이펙티브 C++ (7~9)
Ad

More from I Goo Lee (20)

PDF
MySQL_Fabric_운영시유의사항
PDF
MySQL Deep dive with FusionIO
PDF
From MSSQL to MySQL
PDF
AWS Aurora 100% 활용하기
PDF
Backup automation in KAKAO
PDF
텔레그램을 이용한 양방향 모니터링 시스템 구축
PDF
Federated Engine 실무적용사례
PDF
MySQL 상태 메시지 분석 및 활용
PDF
MySQL 5.7 NF – Optimizer Improvement
PDF
MySQL 5.7 NF – JSON Datatype 활용
PDF
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
PDF
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
PDF
AWS 환경에서 MySQL Infra 설계하기-2본론
PDF
AWS 환경에서 MySQL Infra 설계하기-1도입부분
PDF
AWS 환경에서 MySQL BMT
PDF
MySQL Slow Query log Monitoring using Beats & ELK
PDF
MySQL Audit using Percona audit plugin and ELK
PDF
PostgreSQL 이야기
PDF
Intro KaKao ADT (Almighty Data Transmitter)
PDF
Binlog Servers 구축사례
MySQL_Fabric_운영시유의사항
MySQL Deep dive with FusionIO
From MSSQL to MySQL
AWS Aurora 100% 활용하기
Backup automation in KAKAO
텔레그램을 이용한 양방향 모니터링 시스템 구축
Federated Engine 실무적용사례
MySQL 상태 메시지 분석 및 활용
MySQL 5.7 NF – Optimizer Improvement
MySQL 5.7 NF – JSON Datatype 활용
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL BMT
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Audit using Percona audit plugin and ELK
PostgreSQL 이야기
Intro KaKao ADT (Almighty Data Transmitter)
Binlog Servers 구축사례
Ad

.NET Webservice for MySQL

  • 1. .net webservice for mysql .NET 에서 MySQL 사용하기 2015.08.29 최진혁 1
  • 2. 2 MSSQL 에서의 in/out XML type 인자로 받아 프로시져 내부에서 Parsing
  • 3. 3 .NET 의 Reflection 활용 Parameter Bind Parameter 변경시 매번 코딩은 불편, client – web – database (procedure ) 까지 하나의 class로 관리
  • 4. 4 Information_schema 과다 조회? CBT 이후 information_schema. ROUTINES 조회에 따른 tmp_table 과다 생성 발견
  • 5. 5 Information_schema 과다 조회? Check Parameters Option  Check Parameter = True 시 인자의 개수 와 name 만 맞으면 OK. 순서는 중요하지 않음  하지만 MySQL Connector 가 해당 parameter binding 을 위해 내부적으로 매번 information schema 조회하면서 tmp table 생성 → 성능저하  Check Parameter = False 로 하여 Parameter 개수는 물론 순서가 맞지 않을 시에는 Exception 이 발생하도록 하자!
  • 7. 7 ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET) affect_row vs matched_row  affect_row : CASE WHEN 절의 조건에 포함되어, 실제 Update 가 일어난 row 수  matched_row : WHERE 절의 조건을 만족하는 row 수
  • 8. 8 affect_row vs matched_row SUCCESS Case FAIL Case 의도한 대로 ROW_COUNT() 가 affected_row 로 집계되어, 체크건수와 실제업데이트건수가 맞지 않은 경우 IF 문에 의해실패 처리됨 (실제 2가지의 rune 모두 업데이트 되지 않음 ) on Workbench Connection ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
  • 9. 9 affect_row vs matched_row 의도한 것과 달리, IF 문 체크가 되지 않아, Result 는 0 으로 리턴되고 실제 gold 도 증가함 on MySQL Connector .NET ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
  • 10. 10 Unexpected result on ROW_COUNT()  Connection String option 에 따라 MySQL .NET Connector 에서 실행한 Procedure 내부의 ROW_COUNT() 가 affected_row 또는 matched_row 로 인식될 수 있음  Default 는 Use Affected Rows=False matched_row 해당경우에는 UPDATE 후 ROW_COUNT 체크시 주의해야함. Use Affected Rows=True affected_row ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
  • 11. 11