From: Christian B. (JIRA) <no...@at...> - 2006-05-11 07:54:10
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1741?page=all ] Christian Bauer updated HHH-1741: --------------------------------- Version: 3.2.0.cr2 (was: 3.2.1) (was: 3.1.4) (was: 3.2.0) (was: 3.0 alpha) (was: 3.0 beta 1) (was: 3.0 beta 2) (was: 3.0 beta 3) (was: 3.0 beta 4) (was: 3.0 rc 1) (was: 3.0 final) (was: 3.0.1) (was: 3.0.2) (was: 3.0.3) (was: 3.0.4) (was: 3.0.5) (was: 3.1 beta 1) (was: 3.1 beta 2) (was: 3.1 rc 1) (was: 3.1 rc2) (was: 3.1 rc3) (was: 3.1) (was: 3.1.1) (was: 3.1.2) (was: 3.2.0.alpha1) Assign To: Christian Bauer Priority: Trivial (was: Major) > Bug in reference documentation > ------------------------------ > > Key: HHH-1741 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1741 > Project: Hibernate3 > Type: Bug > Components: documentation > Versions: 3.2.0.cr2 > Reporter: Luca Masini > Assignee: Christian Bauer > Priority: Trivial > > Original Estimate: 1 minute > Remaining: 1 minute > > From paragraph 1.4.1: > "1.4.1. Writing the basic servlet > Create a new class in your source directory, in the events package: > package events; > // Imports > public class EventManagerServlet extends HttpServlet { > private final SimpleDateFormat dateFormatter = > new SimpleDateFormat("dd.MM.yyyy"); > // Servlet code > } > The dateFormatter is a tool we'll need later to convert Date objects from and to strings. It makes sense to only > have one formatter as a member of the servlet." > but if you read the JDK 1.4 and later Javadocs there is a note at the bottom of the description of the SimpleDateFormat class: > "Synchronization > Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally. " > This mean that the example is buggy and will not work if two thread use the same servlet at the same time. Please correct it putting the dateFormatter instantiation into the doGet method. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |