Ralph Jaus wrote:The trick is to use local variables. Actually your code in 3) should better be something like Now each thread works with his own entity manager instance.
Sergio Tridente wrote:
Originally posted by nitin pai:
It does. The lookup is done inside your servlet's service method: once for each thread. That means, each thread will have its own PersistenceContext instance.
12.2.1.5 cascade-persist
The cascade-persist subelement applies to all relationships in the persistence unit.
Specifying this subelement adds the cascade persist option to all relationships in addition to any settings
specified in annotations or XML.
The cascade-persist subelement cannot be overridden in this release.
The ability to override the cascade-persist of the persistence-unit-defaults
element will be added in a future release of this specification.
<filter-mapping>
<filter-name>Filter1</filter-name>
<url-pattern>/Recipes/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter2</filter-name>
<servlet-name>/Recipes/HopsList.do</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>Filter3</filter-name>
<url-pattern>/Recipes/Add/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter4</filter-name>
<servlet-name>/Recipes/Modify/ModRecipes.do</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>Filter5</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Celinio Fernandes wrote:That is not what the DD is made of.
2nd and 4th filter mappings are mapped to servlet names, not url patterns.
That is why you think the answer is wrong.