Friday, September 21, 2007

How to find out JDBC statement leaks in Oracle

Serious leaks can be identified with then following SQL (10g):
select oc.inst_id, oc.sid, oc.hash_value, oc.sql_text, count(*)
from gv$open_cursor oc
where sql_text not like 'COMMIT%'
group by inst_id, sid, hash_value, sql_text
having count(*) > 5
order by 5;

9i or belower use v$open_cursor instead of gv$open_cursor

Friday, July 27, 2007

Java packages management system

Linux has RPM/APT, Mac has Fink, Ruby has RubyGems, why Java hasn't a good packages management system yet? Experienced Java developers know the "Jar-Hell". They know the difficulties to management the dependencies of various jar files. They know the problems when J2EE applications use different versions of common libraries...
Will this Jar-Hell be solved by JSR 277: Java Module System or anything else?

Thursday, May 24, 2007

Text of Steve Jobs' Commencement address (2005)

Text of Steve Jobs' Commencement address (2005)
Steve Jobs says:
...
You can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something — your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.
...
Sometimes life hits you in the head with a brick. Don't lose faith. I'm convinced that the only thing that kept me going was that I loved what I did. You've got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.
...
And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become.

Monday, April 23, 2007

7 Habits For Effective Text Editing 2.0 - Google Video

Basic rules:
find inefficiency; find a quicker way; make it a habit
effective text editing

Habit 1: Moving around quickly
/ to search
use * again and again. * - search for next
use folding

Habit 2: Don't type it twice
Ctrl-N - keyword completion
Omni-completion in Vim 7

Habit 3: Fix it when it's wrong
spellchecker in Vim 7
add new abbrevation - :iabbrev teh the
add keyword for spellcheck - : syntax keyword WordError teh

Habit 4: A file seldom comes alone
ways to find your old files.
:!ctags -R . generate tags for all files under current directory (and sub directory)
:tag init
:tnext
:grep "\\>" **/*.h
:cnext

Go to the file
gf

Habit 5: Let's work together
copy text from vi to Word or other editors.

Habit 6: Text is structured
how to go from warnings/errors to source
map
:cfile %

Habit 7: Sharpen the saw
keep on tuning the set of commands you use
folding
automatic indenting
Plugins
edit files over a network
advanced scripting



Wednesday, March 07, 2007

2007 Annual Dinner

2007 Annual Dinner

It's a wonderful evening. People present a tons of funny staff, make everyone laugh all the time. Laddies' dance, Shui Hu video, YMCA, OOTV, Xiang Sheng brought by Frank & Minmin, song name guessing and Pascal's 'singing'... There are so many wonderful things, I couldn't count them all. I also showed my voice - not singing, but narrating in our team's stage play, In the Mood for Love. Fortunately I didn't ruin this, as the show was interrupted by applause dozens times :)

Someone said, Life is full, full of surprises. So, to be surprised, I took a 'first-class' seat this evening - right beside Pascal! Yeah, it's a real exciting & funny experience for me :) And, I picked a '018' number and wan a first-lass prize at Lucky Draw, an iPod shuffle! I am a lucky man :) I believe it's a sign of good fortune in 2007, year of pig. Wish everyone in OARDC have a fruitful piggy year too!

Thursday, March 01, 2007

An awesome demo movie about integrating Forms & JSF!

An awesome demo movie about integrating Forms & JSF!
It is created by Wilfred van der Deijl, from oraTransplant. He is also going to present his work in ODTUG 2007. Looking forward his great paper:)
www.oraTransplant.nl, it's a good site with many useful material of oracle develop tools. Why I didn't find it ealier?

Sunday, October 29, 2006

I am not a Big Fan of Hate...

I am not a Big Fan of Hate...
Wang Jian Shuo, a famous blogger from Shanghai, China, talk about his opinion about patriotism and hate. It's really touchable, I can't agree him more. Hate others is not a shape of love.



Wednesday, October 25, 2006

Worst practices when using Oracle JDBC Drivers

AMIS Technology blog » Blog Archive » Worst practices when using Oracle JDBC Drivers - great presentation by Douglas Surber
Fortunately Oracle is really making his JDBC driver more standard. I always dislike the former ugly proprietary extensions. Anyway, these bad practices are very helpful.

Wednesday, August 31, 2005

immediate exception when insert duplicate unique key

When 2 sessions simultaneously insert the same primary key value to a table, oracle will block the later session. After the first session is committed, oracle throws an ORA-00001 error: unique constraint ... violated error.
If you hope that oracle don't block insert sessions, you need to implement something using dbms_lock package. Using this, errors will immediately be thrown out when many sessions insert same primary key value, even if these 'insert' haven't be committed. There is an good example from Tom Kyte.
I had thought that 'read uncommitted' transaction isolation level will simply solve this problem. But Oracle doesn't support 'read uncommitted', it implements only 2 transaction isolation levels: read committed(default) and serializable.