How to release database connection?

I have create java code to do search query but my problem is: each time i do the search it take 1 connection, 100 search it take 100 connection :((

try {
RetrieveAndUpdateDRM40Data retrieveAndUpdateDRM40Data = new
RetrieveAndUpdateDRM40Data();
try {

                    RbtCode = retrieveAndUpdateDRM40Data.retrieveByCriteria(
                        c, "TRUETONE", "VIETTEL");
                  }
                  finally {
                    org.vnnplus.drm.DRM40PersistentManager.instance().
                        disposePersistentManager();
                  }
                }
                catch (Exception e) {
                  e.printStackTrace();
                }

Any one known how to relase connection after get the search result

env:
DB: Oralce 10g
JRE:java 1.4.2
OS: SUN

I have found the answer
must call flush() method in the finally insteed of disposePersistentManager ()

so the code must be:

try {
RetrieveAndUpdateDRM40Data retrieveAndUpdateDRM40Data = new
RetrieveAndUpdateDRM40Data();
try {

RbtCode = retrieveAndUpdateDRM40Data.retrieveByCriteria(
c, “TRUETONE”, “VIETTEL”);
}
finally {
org.vnnplus.drm.DRM40PersistentManager.instance().getSession().flush();
}
}
catch (Exception e) {
e.printStackTrace();
}

clap clap :smiley:

Hi Tondalink,

Thanks for your post and it’s a good news that you found the problem on your own.

If there are any inquiries, please do not hesitate to ask.

Best regards,
Lilian Wong

thank for your reply, the DBVA is the most power full tool but the sample for web page is not good design very simple. Do you known the codecharg it is the tool with to generate the web with more template. Did DBVA have any more feature that i miss

Hi Tondalink,

Thanks for your praise to our product! DB-VA is a modeling tool that generated ORM can be used anywhere. We’ll have tutorial to show users how to use the ORM, e.g. on the web. I’ll let you know if the tutorial is ready.

If there is anything I can help, please do not hesitate to contact me.

Best regards,
Lilian Wong