전체 페이지뷰

레이블이 H2db인 게시물을 표시합니다. 모든 게시물 표시
레이블이 H2db인 게시물을 표시합니다. 모든 게시물 표시

2014년 9월 23일 화요일

h2db week in a month


h2db don't have enough functions thus I searched for google
but there are only oracle , ms-sql functions or queries , and explain for extract week

I used week function and parsedatetime I first used at this time

SELECT WEEK (CURRENT_DATE) , DATEADD('DAY',10,CURRENT_DATE), WEEK (PARSEDATETIME(CURRENT_DATE,'yyyy-MM'))
,WEEK (DATEADD('DAY',10 ,CURRENT_DATE))  -  WEEK (PARSEDATETIME(DATEADD('MONTH',1, CURRENT_DATE),'yyyy-MM'))  +1
FROM VW_HOTTREND


SELECT
WEEK (CURRENT_DATE)  -  WEEK (PARSEDATETIME(CURRENT_DATE,'yyyy-MM'))  +1
FROM VW_HOTTREND

I tested the query in a h2db that's so good to me

oracle
SELECT  TO_CHAR(TO_DATE('20131231'),'WW') FROM DUAL;
-> 53
SELECT  TO_CHAR(TO_DATE('20131231'),'IW') FROM DUAL;
-> 01

SELECT  TO_CHAR(TO_DATE('20140115'),'W') FROM DUAL;
-> 3
SELECT  TO_CHAR(TO_DATE('20140215'),'W') FROM DUAL;
-> 4

ms -sql

SELECT DATEPART( wk, @Dt)

2012년 12월 13일 목요일

H2db transaction problem

I open need to use h2db but it is not so compatible and stable
Today I got trouble with h2db . The db is good without other bad transaction
However that do not transaction with delete and update !
Why does this critical problem happen to me ? Wtf
I had more inspect this status !
But nothing problem with db . I think more and more and more investigate
I keep going face at this problems I suddenly had one possible thinking
This should not db lock ! Select is good and update or delete often success
But transaction always return to previous state as rollback
Through Totally this situation i investigate
I suggest that this problems is concurrent transaction problem
My suggest turnout good opportunity !
Another periodical transaction process stopped and then
Delete or update is run very well without any problem
Wow stupid man ! Civilization software profit make stupid man
I should often study open db transaction and security and configure