Oct 7th, 2010, 08:55 AM
Can a Autowired bean can be explicitly destroyed
I have a class SurrogateKeyGenerator in which i have autowired DBCP's BasicDataSource object. There may be a scenario in which BasicDataSource object holding database connections may become stale, if the connections are stale.
1) How can we destroy explicitly and remove the auto wiring reference from the SurrogateKeyGenerator class ?
2) Also can a new bean BasicDataSource be autowired maintaining the same state of SurrogateKeyGenerator object.
Please help on the above two quest.
Thanks in Advance
Tags for this Thread