One important thing is to set priority of this interceptor to be lower than the Spring’s transaction interceptor. That way we want to make sure transaction is created before we start modifying the connection. In other words, you would set order for @Transactional to be less than order for your new interceptor:

We have a system that uses Apache Camel and ActiveMQ. It handles periodic bursts of 20,000 messages. The end consumer is slow and it takes about an hour to process all the messages. On their route, messages are passed from one queue to another. On our production system we stumbled onto an unexpected problem. After finishing few thousand messages the whole system would freeze.

The problem was with ActiveMQ flow control and transacted routes in Camel.

When you have slow consumers, to prevent queues from growing infinitely, ActiveMQ has a limit of how many messages you can put in a queue. When limit is reached, producer is, by default, forced to wait until the resources free. You can set these limits on system level or per queue level. Problem arises when you have transacted Camel route and system limit is reached.

Route that moves messages from queue A to queue B is inside a JMS transaction – you can’t remove message from queue A until the message is successfully placed on queue B.

If system limit is reached, no new messages can be sent to any queue. So, producers are forced to wait, transaction doesn’t complete, messages can’t be taken off queue A and no resource gets freed. The whole processing freezes.

There are numerous ways you can work around this problem. You can turn off flow control and potentially let queues grow indefinitely.

In our case, solution was to set per-queue limits so that system limits can never be reached. Sum of limits for all queues needs to be less than the system limit. That way, as consumer takes messages from queue B, new messages can come in, transactions can complete and messages can be taken off queue A. Messages are consumed from queues A and B at the same pace and the whole system works fine.

In our case, I’ve set memoryLimit to 10m for our 13 queues and system memoryUsage to 180m.

If you want to use DisMax parser in Solr you need to be careful how to index the fields that DisMax will be using.

If you mix fields that filter out stop words (plain text) and fields that do not filter out stop words (like author names), your simple queries might end up with no results.

By default, DisMax will display only results that contain all the words from your query string. If your query has stop words like “ants of madagascar”, stop word “of” might not be found in any of the fields – it’s not in author names and it’s filtered out in article body – and you will get zero results.

Possible workarounds:

Relax Minimum Match (mm) requirement.Downside: Lowering mm will increase number of results. mm of 50% on “ants madagascar” will return all documents that have “ants” and all docs that have “madagascar” in them.

Do not filter out stop words.Downside: Your index can get large and you might get large number of less relevant results.

The results were the same regardless of the parser implementation. Xerces or Saxon.

Xalan’s handling of UTF-8 multi-byte characters seems to be seriously flawed. &#55349;&#56479; are not valid UTF-8 characters and both Xerces and Saxon parsers will throw SAXParseException when trying to parse documents that have them.

A) It’s illegal in Java to have two methods with the same signature returning different types.

B) The order in which these methods are returned would be completely random. For example, this can cause BeanUtils.copyProperties(..) to intermittently fail to copy some bean properties. BeanUtils would take the first get method returned, find that the return type is not matching corresponding set method and skip it.

The bug is present in both Java 5 and 6. There are several bugs filed around this problem. For example: 6422403 and 6528714. The bad news is that this is not going to be fixed until Java 7.

Update:This is not a bug but a feature. One of the methods returned by introspection is synthetic. Unfortuntely, code written for Java prior to 1.5 like Commons BeanUtils do not recognize this and will break in described situation.

Experience-driven activity plays an essential role in the development of brain circuitry during critical periods of early postnatal life, a process that depends upon a dynamic balance between excitatory and inhibitory signals. Since general anesthetics are powerful pharmacological modulators of neuronal activity, an important question is whether and how these drugs can affect the development of synaptic networks. To address this issue, we examined here the impact of anesthetics on synapse growth and dynamics. We show that exposure of young rodents to anesthetics that either enhance GABAergic inhibition or block NMDA receptors rapidly induce a significant increase in dendritic spine density in the somatosensory cortex and hippocampus. This effect is developmentally regulated; it is transient but lasts for several days and is also reproduced by selective antagonists of excitatory receptors. Analyses of spine dynamics in hippocampal slice cultures reveals that this effect is mediated through an increased rate of protrusions formation, a better stabilization of newly formed spines, and leads to the formation of functional synapses. Altogether, these findings point to anesthesia as an important modulator of spine dynamics in the developing brain and suggest the existence of a homeostatic process regulating spine formation as a function of neural activity. Importantly, they also raise concern about the potential impact of these drugs on human practice, when applied during critical periods of development in infants.