java - Spring 3 class suitable for frequent creation and close of database connection -
my application has multiple jvms , each jvm required connect database inserting process details(like cpu usage, memory stat) @ frequency of 5 minutes.
total number of jvms 40, cant maintain 40 connection open database time. want create connection , destroy after insert done (insert not take more second).
my application uses spring 3, question there class in spring framework can allow create , destroy connection each time insert.
[looked jdbctemplate api, singledatasource connection mill doesn't suit requirements]
handling of resources database connections automatically closed in frameworks spring. doing explicitly can seek
<bean id="datasource" class="org.apache.commons.dbcp.basicdatasource" destroy-method="close"> or close connection manually like
getdatasource().getconnection().close()
java spring
No comments:
Post a Comment