Singleton class issue 2004-11-17 - By Kevin Gaasch
Back Hello Bill, If your using J2EE, use the Datasource/Connection pooling feature of your container. Things like concurrency, transaction management, etc..., are the responsibilty of the container.
Kevin E. Gaasch Panhandle Plains Student Loan Center Software Craftsman Senior Programmer/Analyst Sun Certified Java Programmer Work: 806.324.4108 Cell: 806.674.1523
>>> bcai_2003@(protected) 11/17/2004 8:10:46 PM >>> Hello, I am developing web application based on j2ee technology:jsp, java bean and jdbc. I ceated a singleton class called "JdbcController.java" that takes the responsibility to establishing connection to DB and works fine. But my concern is :since this is multi-thread application. every thread will invoke JDBCController class . i am wondering if this will result in concurrent issue becase every thread will compete to use this class to get connection to DB. one alternative is :i don't use singleton pattern. when every thread needs to get access to DB, it will ceate new instance of JDBCControoler object. but it will use lot of memory although JVM has garbage collection mechanism. So which way is better according to you guys' experience. Please let me know. Thanks bill
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
CONFIDENTIALITY NOTICE The information contained in this message and/ or its attachments may be privileged and confidential, and is intended only for the use of the individual (s) named above. If you are not the intended recipient, you are notified that any dissemination, distribution, or copying of this communication is strictly prohibited and are requested to delete the message and/or its attachments. If you have received this communication in error please notify us immediately by telephone at (806) 324-4100. Panhandle-Plains Student Loan Center (PPSLC), has taken reasonable precautions to ensure that any attachment to this e-mail has been scanned for viruses. We specifically disclaim all liability and will accept no responsibility for any damage sustained as a result of software viruses. We advise you to carry out your own virus checks before opening any attachment.
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|