On Wednesday 18 March 2009 00:31:31 Daniel Cheng wrote: > On Wed, Mar 18, 2009 at 7:20 AM, <[email protected]> wrote: > > Author: toad > > Date: 2009-03-17 23:20:32 +0000 (Tue, 17 Mar 2009) > > New Revision: 26071 > > > > Modified: > > branches/db4o/freenet/src/freenet/support/io/BaseFileBucket.java > > branches/db4o/freenet/src/freenet/support/io/FileBucket.java > > branches/db4o/freenet/src/freenet/support/io/TempFileBucket.java > > Log: > > Fix deleting shadowed tempfiles on exit, and never deleting even if deleteOnExit=true if it is a parameter. > > Paranoia, logging. > > > > > > Modified: branches/db4o/freenet/src/freenet/support/io/BaseFileBucket.java > > =================================================================== > > --- branches/db4o/freenet/src/freenet/support/io/BaseFileBucket.java 2009-03-17 23:18:47 UTC (rev 26070) > > +++ branches/db4o/freenet/src/freenet/support/io/BaseFileBucket.java 2009-03-17 23:20:32 UTC (rev 26071) > > @@ -35,15 +35,16 @@ > > public BaseFileBucket(File file) { > > if(file == null) throw new NullPointerException(); > > this.length = file.length(); > > - if(deleteOnExit()) { > > - try { > > - file.deleteOnExit(); > > - } catch (NullPointerException e) { > > - if(WrapperManager.hasShutdownHookBeenTriggered()) { > > - Logger.normal(this, "NullPointerException setting deleteOnExit while shutting down - buggy JVM code: "+e, e); > > - } else { > > - Logger.error(this, "Caught "+e+" doing deleteOnExit() for "+file+" - JVM bug ????"); > > - } > > + } > > + > > + protected void setDeleteOnExit(File file) { > > + try { > > + file.deleteOnExit(); > > + } catch (NullPointerException e) { > > + if(WrapperManager.hasShutdownHookBeenTriggered()) { > > + Logger.normal(this, "NullPointerException setting deleteOnExit while shutting down - buggy JVM code: "+e, e); > > + } else { > > + Logger.error(this, "Caught "+e+" doing deleteOnExit() for "+file+" - JVM bug ????"); > > More likely this file have been "deactivated" then being a JVM bug. > > Consider how other db4o application do this, the > activate-deactivate-reactivate usage is uncommon. > Most other applications never reactivating objects. > I guess your usage pattern is not well tested in production.
Some big embedded apps do use activation/deactivation extensively; one of testimonials mentioned this, so I had hoped it would be well supported. But you're probably right: it's probably very far from mainstream usage... :| I don't understand what is happening here; it only happens during shutdown ...
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
