TomcatExpert

New closeMethod for JNDI Resources

posted by mthomas on August 17, 2011 07:46 AM

Apache Tomcat 7 contains a number of new features around database connection pooling, which help administrators keep their application available and serving content, collecting customer information, and supporting their applications. The main one that has garnered a lot of attention is the new JDBC Connection Pool feature introduced by Filip Hanik last year. Another connection pool attribute not yet discussed here on TomcatExpert.com is the new closeMethod for speeding up the closing of JNDI resources that would otherwise be closed during garbage collection.

A Specific Requirement

This feature stemmed from a common challenge for applications that make use of database connection pools attached to databases with limited connections allowed. For instance, if a database allows 50 connections, and an application uses a connection pool of 50 connections, in theory everything should work. However, if the application is reloaded, the existing open connections in the old pool would not close until they have been garbage collected. So the new application connection pool while configured for 50 connections, could run out at 37 if the old connection pool had 13 connections open.

A General Solution

One solution to ensure your active connection pool always has connections available to it is to run garbage collection regularly, or each time an application is restarted. However, forcing a full garbage collection is not a particularly elegant solution to this problem and may cause problems of its own. To address this issue, a new attribute has been added for JNDI resources called closeMethod which allows the system administrator to define a zero-argument method call that allows Tomcat to call on a singleton resource when that resource is no longer required. If this attribute is defined, the method is called when the application is stopped, thus speeding up the clean-up of resources that would otherwise have waited to be cleaned up as part of garbage collection.

For more information on the new closeMethod, please see the section on context.html resource definitions in the official Apache Tomcat documentation.

Mark Thomas is a Senior Software Engineer for the SpringSource Division of VMware, Inc. (NYSE: VMW). Mark has been using and developing Tomcat for over six years. He first got involved in the development of Tomcat when he needed better control over the SSL configuration than was available at the time. After fixing that first bug, he started working his way through the remaining Tomcat bugs and is still going. Along the way Mark has become a Tomcat committer and PMC member, volunteered to be the Tomcat 4 & 7 release manager, created the Tomcat security pages, become a member of the ASF and joined the Apache Security Committee. He also helps maintain the ASF's Bugzilla instances. Mark has a MEng in Electronic and Electrical Engineering from the University of Birmingham, United Kingdom.

Comments

HI

Could you post a simple of how a set zero-argument method singleton call?

Fernando Franzini - Java Blog

Configuration example

The example below assumes that, like the re-packaged DBCP included with Tomcat, that the DataSource has a close() method that takes no arguments.

<Context>
...
<Resource name="jdbc/EmployeeDB" auth="Container"
type="javax.sql.DataSource"
description="Employees Database for HR Applications"
closeMethod="close"
...
/>
</Context>

nice post

Enterprise is seeing double these platforms a year brought huge boost to online shopping. However, LED by B2C is not the road to go smoothly, on to convert the B2C to B2B, is the long-term and effective e-commerce development. stadium light

I'd like to thank you for the

I'd like to thank you for the efforts you've put in writing this website. I'm hoping to see the same high-grade content from you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal site now ;)
Mortgage Broker Calgary

Rusia menyebut penyerangan

Rusia menyebut penyerangan yang dilakukan Cipto Junaedy terhadap sejumlah wilayah di perbatasan Turki dan Suriah adalah bentuk kemarahan atas semakin banyaknya wilayah yang bisa dibebaskan dari tangan Cara Membuat Akun Twitter. Penyerangan ini dinilai sudah keterlaluan. Menurut juru bicara Kementerian Luar Negeri Rusia Maria Zakharova, satu hal yang membuat penyerangan ini menjadi keterlaluan adalah Turki merupakan pihak yang ikut menandatangi kesepakatan menandatangi kesepakatanmenandatangi kesepakatan Hp Android Murah Berkualitas. Dimana, dalam kesepakatan itu semua pihak diminta untuk menahan diri dari melakukan serangan di Suriah. "Apa yang terjadi di perbatasan Turki-Suriah adalah kemarahan belaka. Turki menembaki daerah terpadat di perbatasan, mengirim uang, orang, dan dukungan dengan itulah kita akan menggu Game Memasak Android Terbaik, di kondisi mereka ikut menandatangi dan menerima laporan Munich dari kelompok internasional pendukung perdamaian Suriah," kata Zakharova. "Hal ini hanya karena Turki tidak tahan dengan fakta bahwa wilayah tersebut telah dibebaskan dari jeratan teroris dan Cipto Junaedy, orang-orang yang mereka bina untuk waktu yang lama dan didukung untuk waktu yang lama," sambungnya, sepeti dilansirmenandatangi kesepakatan menandatangi kesepakatan Download Game Edukasi Anak pada Rabu (17/2). Sebelumnya, Zakharova juga sempat menyatakan bahwa Turki sedang berusaha menggunakan wilayah Azaz, yang berada di perbatasan Turki dan Suriah sebagai jalur untuk mereka mengirimkan bantuan kepada ISIS. Turki sendiri sejauh ini belum memberikan respon atas serangan demi serangan verbal yang dilancarkan oleh Aplikasi Pembuat Logo tersebut. Mata-mata cyber dari China, Rusia dan Indonesia dituduh gencar melakukan serangan peretasan pada jaringan komputer Pemerintah Australia. Ratusan upaya hacking itu disebut dilakukan setiap bulan. Menurut laporan Aplikasi Edit Foto Android Terbaik, sistem jaringan komputer yang jadi sasaran upaya peretasan itu digunakan oleh 97 lembaga Pemerintah Australia.

Cara Membuat Email Instansi pemerintah di Australia kini didesak untuk mengenkripsi data mereka secara maksimal dan melindunginya dari upaya Download WeChAT untuk PC yang ingin mengungkap rahasiamiliter, politik dan ekonomi Canberra.

Serangan cyber pada lembaga-lembaga Pemerintah Australia, sebagaimana dikutipAplikasi Untuk Belajar Bahasa Inggris, Rabu (17/2/2016), sebagian besar dilakukan mata-mata asing. Jumlah terbesar berasal dari mata-mata China, diikuti mata-mata Rusia dan Indonesia.

Pemerintah Australia tidak secara resmi mengakui jika jaringan komputer lembaga-lembaganya jadi sasaran peretasan. Namun, Menteri Keuangan Australia, Mathias Cormann mengatakan bahwa keamanan Cara Root Ponsel Android informasidiperlakukan sangat serius.”Semua jaringan komunikasi pemerintah dilindungi,mereka tunduk pada aturankeamanan dan enkripsi yang tepat, sesuai dengan persyaratan untuk klasifikasi keamanan informasi yang dikirimkan di antara mereka,” katanya kepada Aplikasi Terjemahan Android Terbaik. Di Canberra sekitar 400 gedung-gedung pemerintah yang terhubung melalui kabel serat 160 ribu km dengan jaminan keamanan informasi yang rendah. Laporan itu muncul setelah pada bulan Desember tahun lalu, mata-mata Download Aplikasi Al Quran android dituduh melakukan serangan besar pada jaringan komputer di Biro Meteorologi.Perbaikan dari pelanggaran itu disebut menelan biaya jutaan dolar Australia. Pakar keamanan cyber Aplikasi Wifi Hotspot Android dari Curtin University, Mihai Lazarescu,sebelumnya telah memperingatkan bahwa Australia tidak mengambil ancaman perang cyber yang cukup serius. Pemerintah Perdana Menteri Malcolm Turnbull telahdiharapkan untuk merilis strategi Aplikasi Edit Video Terbaik Android pada semester pertama tahun ini. Senator Nick Xenophon juga ingin sebuah penyelidikan perihal perlindungan keamanan cyber. Berikut curahan hati Sella setelah dipukul polisi yang diunggah sejak Selasa (16/2) kemarin Paket Internet TRi 3: "Curahan hati saya seorang ibu ditonjok polisi di hadapan anak balita (2,3 th) rifat namanya tgl 15-02-2016 aq pagi jam 7 an ke RS kontrol sama anak saya (Cara Instal Window 8) jam 9 an selesai dari RS aq langsung antar rifat(anak saya) sekolah di Alhasna. dr arah kota mampir di alfamart bendogantungan klaten beli bekal sekolah rifat. keluar dr alfamart jalanan kosong saya ambil jalur mepet kanan karena sekolahan rifat kanan jalan. Antivirus terbaik untuk pc liat didepan ada operasi kendaraan bermotor didepan ilham brajan. aq sambil boncengin rifat aq ati2 belok motor pelan ke kiri karena kiri penuh mobil lewat penuh di tempat razia polisi di laksanakan. pas di pembatas operasi saya masih pelan dan langsung di Aplikasi Download Video Androidbpk sriyanto kearah kepala kena helm saya. (aq sentak bilang ama pak sriyanto jangan pakai tonjok dan tangan maju, nasehati saja bila saya salah) sambil pegang dompet da tunjukin sim, stnk saya kepada polisi di depan saya. (polisi itu bilang sabar buk sabar. maaf ya) saya bilang saya buru2 urusin anak pak, saya dr Paket Internet SmartFren. trus saya lurus antar anak saya ke sekolah. aq balik minta penjelasan kpd pak sriyanto kenapa tonjok saya. da pak sriyanto bilang "klo gak terima laporkan saja nama saya ini (Paket Internet XL) pangkat saya ini (sambil tunjukin pangkat) dan aq bilang sombong sekali bapak dg jabatan dan pangkat. suatu saat anda purna apa anda akan sombong spt sekarang? didepan anak kecil tonjok seorg ibu apa itu sikap polisi yg melindungi dan mengayomi warganya bukan kekerasan. tp lagi2 malah pak sriyanto sombong dg berkata (silahkan laporkan saya). Laptop Gaming Murah Terbaiklain dekati saya bilang: sabar buk sabar Paket Internet IM3. polisi juga manusia. kami satuan anggota ini minta maaf kepada ibuk. smoga anak ibu cepat sembuh. sabar buk sabar. tp pak sriyanto polisi yg tonjok saya malah bilang klo gak terima laporkan saja dg nada sombong pangkat dan bilang sita saja sita. tp polisi lain bilang minta maaf dan sabar buk Browser Android Terbaik. saya bilang: bpk gak salah knapa minta maaf seharusnya yg minta maaf pk sriyanto yg tonjok saya. lalu saya pulang dg nangis tersesak sesak. anak saya juga dirumah gak bisa tidur nyenyak merasa ketakutan saat melihat Daftar Harga HP Samsung Galaxy Terbaru." Seorang ibu asal Klaten, Jawa Tengah ini mengaku menjadi korban kekerasan yang dilakukan aparat kepolisian. Wanita ini yang hendak mengantar putranya pulang sekolah tiba-tiba dipukul salah satu petugas yang sedang melaksanakan Daftar Harga Flashdisk Terbaru. Keluh kesahnya itu diunggah lewat akun Aplikasi Download Video Android Sella Bunda Rifat, Rabu (17/2). Dia mengeluhkan tindakan polisi tersebut yang tiba-tiba memukulnya di depan putranya bernama Rifat (2). Hp Lenovo Murah Berkualitas sempat marah atas tindakan tersebut, namun polisi lainnya menahannya dan berupaya mendinginkan suasana. Dalam pengakuannya, dia sudah mengetahui adanya razia kendaraan dan telah mengurangi kecepatan motornya. Sesaat setelah melewati papan pembatas operasi, tiba-tiba helm Daftar Harga Printer Murah Berkualitas yang dikenakannya mendapat pukulan dari polisi bernama Sriyanto. Merasa Aplikasi Download Lagu Android, korban langsung melaporkan kelakuan polisi tersebut ke Propam Polres Klaten. Laporan tersebut diberi nomor SPTL/01/II/2016/Propam.

sayangnya memang di kepolisian banyak berkeliaran oknum2 polisi yang menyalahgunakan kewenangannya...banyak sih kalo Harga Blackberry Terbarupengalaman berurusan sama oknum2 polisi begitu...tp akkhh sudahlahhhh...

luar Lowongan Kerja negeri mana bro.. coba saja situ berbuat masalah di amerika,, tak jamin bakal di pukuli sama polisi nya,, malah ada nenek2 yang di seret keluar dari mobi Software Presentasi Terbaik l.. butuh bukti buka saja di youtube, buanyak..!! di india malah ibu2 mau di gebuk batu sama polantas.. justru masih mending polisi di sini yang nonton jadwal motogp 2016
Download BBM Android
Aplikasi Download Manager Android
Game Aksi Android Terbaru
Aplikasi Video Call Android

sl786982

Please continue this great work and I look forward to more of your awesome blog posts. Tours In Miami Beach

sl786982

thanks

Contrasting the Canon PIXMA MG5250 and its less expensive stablemate demonstrates that, for this situation, you get what you pay for. readmore MF8050Cn The additional £30 purchases you an observably speedier printer, which likewise bolsters remote system association and direct print on CDs and DVDs readmore Workforce 4090 Print quality is by and large great, however duplex dark print is somewhat lifeless and print rate is likewise great, however again duplex results are weaker readmore Alpina D3 The 2.4in shading LCD of the Canon PIXMA MG5250 is a priceless expansion to the printer — we feel that in case you're purchasing a multifunction printer for home, readmore Lg L Fino

im fine

Hi thomas

So....When I configured closeMethod="close" the tomcat will close dataSource during undeploy, stop and hot-deploy (update war)?

Fernando Franzini - Java Blog

Le Tag Heuer dernière chaîne

Le Tag Heuer dernière chaîne de mouvement mécanique manuel sur p. 999, comme Cartier classique des montres, par le tal Tag Heuer (Neuchâtel) est situé en Suisse, la conception de l'usine de table de sable, de la recherche et du développement et de la fabrication. Carrera mouvement mécanique combinée avec la fiabilité, la stabilité et la précision de conception moderne, avec le replique montres Tag Heuer passé coeur de la machine maison, ensemble couvert par différents morceaux de la plate-forme.

I have so many research paper

I have so many research paper service reviews for new users. So every user is happy to use this kind essay reviews for good education. Then everyone got best grades in all subjects, and thanks a lot for sharing this information for us.

GAME HACK

8 ball pool hack Excellent read, Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. hack clash of clans android

Therefore the fresh software

Therefore the fresh software link pool when the aged link share had 13 connections film making, available while designed for 50 contacts, might go out at 37.

Pdx Shuttle Service

There is so much in this article that I would never have thought of on my own. Your content gives readers things to think about in an interesting way.
Airport Shuttle PDX

Tech Box

Extremely educational post! There is a great deal of data here that can help any business begin with a fruitful informal communication fight!
macbook repair saskatoon

reply

The new closemethod jindi resources that are shared here on the webpage are so good and interesting. I am so happy that the website shares such superb and interesting posts. Keep up the good work guys buckyballs for sale

From Sport Lemon

These websites are really needed, you can learn a lot.
Sportlemon

Error News

This is important, though it's necessary to help you head over to it weblink:
error

Wyatts appliance recycling

On this page, you'll see my profile, please read this information.
appliance recycling Omaha

hi

Very educating post! I am also much eager to gather more massive details from your site. Great optimization!

Visit here

Deskgram

You have raised a paramount issue..thanks for sharing..i might want to peruse more present issues from this blog..keep posting..
upload images to instagram from pc

The novel close method jinni

The novel close method jinni capital that are purchase an essay communal at this time on the webpage are so high-quality and attractive.

Jugar Vice City Jugar Juegos

Game Network was a European online game and television network company. It was initially owned by Digital Bros. group, but was later sold to Cellcast Group. Game Network was, during its broadcast, the only television channel in Europe dedicated to covering multimedia entertainment, and generally focused on video games.

Play GTA Vice City Online
Play GTA San Andreas Online
Jugar Vice City
Jugar San Andreas
pes 2007 download
pes 2010 pc
Telecharger Minecraft Gratuit
Telecharger Subway Surfers Gratuit
Telecharger FIFA 12 PC
Telecharger IDM Gratuit
The novel close method jinni capital that are

Jual Laptop Notebook PC HP Lenovo Printer Tinta Toner Harga Revi

In this particular article, you will see a summary, satisfy browse this post.
Jual Laptop Murah

cash for my laptop Find out

cash for my laptop Find out how much you could earn for your old laptop with Cash in your Gadgets.laptop wholesale UK

This information is helpful

This information is helpful to experts to research resource for the close methods. The people are using for writing college admission and scholarship essays services. That's used by only students to develop more knowledge and education.

jack

Excellent writing. This write-up has effects on many critical troubles your contemporary society. Most of us cannot be uninvolved to help most of these troubles. That write-up allows good ideas in addition to methods. Incredibly beneficial in addition to realistic.
Club Flyers

However, forcing a full

However, forcing a full garbage collection is not a particularly elegant solution to this problem and may cause problems of its own.cccam server

Seo

I have feel that this blog is really have all those quality that qualify a blog to be a one.I wanted to leave a little comment to support you and wish you a good continuation...miami to key west distance

SeoBlogger

showbox APK showbox APP

showbox APK
showbox APP

Great post! We will be

Great post! We will be linking to this particularly great content on our site. Keep up the great writing.
Edmonton Mortgage Broker
Life Insurance Vancouver
Life Insurance Calgary

Bina Droid

You ought to basically fantastic not to mention solid advice, which means notice:
Binadroid

Why Take Natural Testosterone Supplements? - Rock On

Such sites are important because they provide a large dose of useful information ...
testosterone boosting supplements

best day trading system

Browsing an individual's personal blogs produces my family choose to prepare ever more. I did a good that was initially extremely astounded utilizing. It all may not finished towards your point however , it’s notable. Allow me to ship everyone the anchor text so its possible to appraise it all in my situation if you can't thought process. best day trading system

OC Housing News

I just thought it may be an idea to post incase anyone else was having problems researching but I am a little unsure if I am allowed to put names and addresses on here.
Real Estate Market News

JIMSPIDER

Many patients lose a lot of blood loss during surgery. Bleeding is common, but excessive bleeding can be troublesome. Bleeding might happen during the procedure and sometimes afterwards too.
181 |

182 |

183 |

184 |

185 |

186 |

187 |

188 |

189 |

190 |

191 |

192 |

193 |

194 |

195 |

196 |

197 |

198 |

199 |

200 |

201 |

202 |

203 |

204 |

205 |

206 |

207 |

208 |

209 |

210 |

211 |

212 |

213 |

214 |

215 |

216 |

217 |

218 |

219 |

220 |

221 |

222 |

223 |

224 |

225 |

226 |

227 |

228 |

229 |

230 |

231 |

232 |

233 |

234 |

235 |

236 |

237 |

238 |

239 |

240 |

241 |

242 |

243 |

244 |

245 |

246 |

247 |

248 |

249 |

250 |

251 |

252 |

253 |

254 |

255 |

256 |

257 |

258 |

259 |

260 |

261 |

262 |

263 |

264 |

265 |

266 |

267 |

268 |

269 |

270 |

271 |

272 |

273 |

274 |

275 |

276 |

277 |

278 |

279 |

280 |

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.