From: Dmitriy S. <sha...@gm...> - 2011-03-03 07:16:00
|
On Thu, Mar 3, 2011 at 11:19 AM, Loren Cahlander <lor...@gm...>wrote: > You will also see that those two lines are close together. > > try { > broker = brokerPool.get(systemSubject); > > if (broker == null) { > LOG.error("No system subject"); > return; > } > > DocumentImpl document = buildDocument(broker); > > try { > collection = broker.openCollection(collectionURI, > Lock.WRITE_LOCK); > LOG.info("collection: " + collection); > if (collection == null) { > return; > } > transact = brokerPool.getTransactionManager(); > txn = transact.beginTransaction(); > * info = collection.validateXMLResource(txn, broker, > docURI, document);* > LOG.info("INFO: " + info.toString()); > } finally { > if (collection != null) > collection.release(Lock.WRITE_LOCK); > } > > * collection.store(txn, broker, info, document, false);* > If something happen at *validateXMLResource *it will be catch by first try-finally and process *store* , that's wrong!!! So, please put it into one try-finally block (that mean 'closer'). -- Dmitriy Shabanov |