Hi!

I'm using H2 as the backend for a desktop application, in the embedded
mode. All my data access code follows the same pattern: get a
connection from a datasource (which ends calling
DriverManager.getConnection), call the appropiate DAO method, commit
and close the connection.

To improve performance, I added DB_CLOSE_DELAY=-1 to the connection
string, but shown no real benefit. So I modified my datasource a
little, to only open a connection for the first time and return the
same one in the following calls. Of course, I also wrap it in a proxy
so Connection.close() has no effect at all.

Now performance is much better, but I wonder if there could be some
trouble when using this approach. Or could the connection become
"invalid" some time in the future?

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-database@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to