Originally posted by Seetesh Hindlekar:
Hi Kather,
Question : How are you planning to handle concurrent users trying to access your web-site considering U using Singleton pattern to db access?
Wont the process slow down if multiple users try to post some data simultaneously in the database.
Seetesh
Hmmm... what I would suggest entirely depends on where you are right now. I know the stack I would probably attack this problem with, but that's not of much use to you: too much new stuff, probably.Originally posted by Kather Basha:
we are planning to develop a web module which doesn't have any EJB, instead is having ordinary Java Bean Components. we have some idea in our mind, pl tell me is it suitable or any changes/suggesions on it. [...] is it ok?
JSP 2.0, preferably, seeing that you're using Tomcat anyway; and certainly making use of the JSTL.presentation - jsp pages
The controller should never be looking up the database connection; that's something you would prefer to postpone 'till the DB layer or, if you need to control transactions explicitly, the business logic layer.FormBean to accept user inputs(communicate between jsp and servlet)
controller - servlet
single - FontController(to process user request, JNDI lookup to get db connection, reading property file to invoke action classes)
Please tell me you're going to use an existing MVC framework such as Struts or Spring MVC. The last thing the world needs is another MVC framework!we planning to go for reflection - using single interface for all action classes and at runtime to get the appropriate class.
Ok, I guess. Do not, I repeat not, ever, try to write raw JDBC code though. Writing solid JDBC code is both very hard and very boring, and consequently most JDBC code that gets written isn't solid. Use at least a JDBC library such as the Spring JDBC template and friends. Consider using an O/R mapping tool such as Hibernate or JDO.Model -
java beans(getter and setter methods getting populated from db processor classes, travelling between database and servlet)
java processor classes doing db manipulation.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
No, unless the DAO would be so stupidly written as to require synchronization. Other than that there is no limit to the number of threads that can execute against a single DAO; each would get their own connection drawn, as Mandira notes, from the Tomcat connection pool.Originally posted by Seetesh Hindlekar:
Question : How are you planning to handle concurrent users trying to access your web-site considering U using Singleton pattern to db access?
Wont the process slow down if multiple users try to post some data simultaneously in the database.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Peter den Haan:
Forgot - Rod Johnson and Juergen Hoeller have written a book with exactly this title (j2ee without EJB) and it comes highly recommended. I am prejudiced, though, having been one of the book's tech reviewers.
- Peter
Probably not. But do get the book anyway (no, I'm not getting any commission ). I think my recommendation would be:Originally posted by Kather Basha:
Thanks Mr.Peter for your inputs, but i'm already very new to J2EE environment. so i think i can't directly go for DAO/Hibernate/Spring framework.
Download Spring 1.0.2 and have a look at samples/petclinic/, specifically with the JDBC data access implementation. It uses the Spring bean container, MVC framework, declarative transactions, and JDBC support. It demonstrates proper use of JSPs, separation of concerns in an MVC architecture, validation, and a simple object model. You will also get to know the essential Log4J, Ant, and JUnit tools a bit. It's small enough that you stand a fighting chance of making sense of it, and large enough to demonstrate what you need to know. Feel free to ask questions.pl ge me the right solution or any sample we application site that matches my requirement.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|