Offtopic: Architecture Question

2000-05-16 Thread Radhakrishnan, Sanjay (c)

We are building a B2B exchange for the semiconductor industry. Theres  a
intranet version which is going to support 150 users, we are currently in
the process of building using JSP/Servlets and JavaBeans, we are using
DbConnectionBroker for connectionpooling services and JRUN as the
JSP/Servlet platform.

Question: The Client wants us to build an internet version of the system,
and obviously it has to be much more scalable(probably about 10,000 or more
users) than the intranet version. My Question is do we have to re-architect
the intranet system and go for an App Server like BEA Weblogic or IBM
WebSphere or does/can the Jrun architecture handle this load.  This system
is not very transaction intensive and does not have the data concurrency
problems which most OLTP systems have.

Appreciate your inputs

Thanks for your time
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Connection Pool

2000-04-13 Thread Radhakrishnan, Sanjay (c)

Hi Thomas,

I have 2 questions,

1. the protected instance in the Singleton class should be static
right? and Im sure thats what you meant.

2. Also shouldn't you make both the get and put methods thread safe.
You've mentioned that only the Put method should be thread safe. Can i
Synchronize on the static instance to make the methods threadsafe

Thanks for your time
Sanjay

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 04, 2000 10:53 AM
To: [EMAIL PROTECTED]
Subject: SV: Connection Pool


Hi Sanjay
The best way is to implemets a Singelton (see the GoF book) that uses a
ConnectionPool.

public class ConnectionPoolAsSingelton {
  protected ConnectionPoolAsSingelton instance; // Store the
Singelton here

  private ConnectionPoolAsSingelton(...) { // yes private
constructor
  
  }
  public static ConnectionPoolAsSingelton getInstance() {
if(instance==null)
  return new ConnectionPoolAsSingelton();
else
  return instance;
  }
  //Put methods for your connpool here but keep in mind that this
code should bee thread safe.
}

to get an instance of connectionpool just call the static function
  ConnectionPoolAsSingelton pool =
ConnectionPoolAsSingelton.getInstance();

This should work fine but if you have any problems pleas email me att
[EMAIL PROTECTED]

/Thomas







   -Ursprungligt meddelande-
   Från:   [EMAIL PROTECTED]
   [SMTP:[EMAIL PROTECTED]]
   Skickat:den 4 april 2000 15:57
   Till:   [EMAIL PROTECTED]
   Ämne:   Connection Pool

   I am trying to set up a connection pool for my JSP Project. Now I
   know that
   there are few ways to implement a connectionpool.  My first thought
   was to
   put in the the servlets init method,But then what do i do for my
   other
   servlets/JSPs, do i create a connectionpool for every servlet?.

   Is there a standard technique for implementing connection pools.  I
   think
   the best solution would be to have it in a common place which all the
   JSPs
   and servlets can access, something like a global.asa file in ASP.

   I would like to hear your thoughts on this.

   Thanks for your time
   Sanjay

   =
   ==
   To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
   JSP-INTEREST".
   Some relevant FAQs on JSP/Servlets can be found at:

http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
<>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Connection Pool

2000-04-04 Thread Radhakrishnan, Sanjay (c)

I am trying to set up a connection pool for my JSP Project. Now I know that
there are few ways to implement a connectionpool.  My first thought was to
put in the the servlets init method,But then what do i do for my other
servlets/JSPs, do i create a connectionpool for every servlet?.

Is there a standard technique for implementing connection pools.  I think
the best solution would be to have it in a common place which all the JSPs
and servlets can access, something like a global.asa file in ASP.

I would like to hear your thoughts on this.

Thanks for your time
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Illegal Operation with JRun and JDBC on Win 95

2000-03-16 Thread Radhakrishnan, Sanjay (c)

I have simple JSP page which makes a db connection to an access database
using the JDBC-ODBC bridge driver. The page gets the info from one do the
tables and displays it as HTML.

If I hit the referesh this page on the browser for more than thrice i get an
Illegal Operation error from windows 95.

Is this because of the JDBC-ODBC bridge.   Im using Jrun for my JSP and
Apache web server 1.3.x

Have anyone experienced this problem, if so can you share your thoughts.

Thanks for your time.
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Controlling Threads in Servlets/JSP

2000-02-07 Thread Radhakrishnan, Sanjay (c)

I am writing a servlet/JSP which spawns three java threads and has to wait
for the 3 threads to finish processing before sending the results got from
the threads to the client browser.

Here a gist of what i do

---
doGet method

create thread1
create thread2
create thread3

start thread1
start thread2
start thread3

wait for all threads to complete. This could be a while loop

While(atleast one thread is running) sleep

send output back as html.
---
I know this can be done in different ways using wait/notify and
yield/suspend/resume etc.

I would like to hear from you guys about the most efficient way to do it.

Appreciate your inputs
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



OFFTOPIC: Data Concurrency & Consistency

2000-01-21 Thread Radhakrishnan, Sanjay (c)

Im wondering if there are any tools/libraries/frameworks which allows
applications written in Java to easily maintain data concurrency/consistency
.

Let me give a case where i would need this tooll/library.

User 1 selects records 1,2 & 3 from table A
User 2 selects records 1,3 & 4 from table A

User 2 updates record 1 with a different set of values.

Now User 1 tries to update record 1 with his set of values. But user 1s
update would fail because he won't be able to find the record he
retrieved(i.e. record 1) as it would have been already changed by user 2.

To avoid this the app would have include the original values that user 1
retrieved from the database initially. If the app does this then there wont
be a match in the database for this update statement and the app can flash a
message to user 1 saying the record has already been updated/deleted by
another user.

Do any of you know of a tool/library/bean which can give the same type of
functionality. Ideal case would be i would just have to declare to the bean
to use Key and Modifiable columns or Just Key columns or Key and updateable
columns in the where clause and it would generate the update/insert/delete
statement accordingly.

Appreciate your inputs
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Re: Members of SessionBeans in JSP

2000-01-05 Thread Radhakrishnan, Sanjay (c)

Craig,

I really appreciate your inputs. I fully agree with your comments as
to not storing resultsets in session beans. I was just trying to understand
how sessionbeans are made persistent,Infact I was planning to use some other
Java Object similar to the CachedRowSet from JavaSoft and store that in my
session bean. I am happy that thats the recommended approach.

One more question: What would i have to do in order to destroy a
session bean in the middle of a session. That sounds like an Oxymoron
doesn't it.

Thanks for your time
Sanjay



-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 05, 2000 3:57 PM
To: Radhakrishnan, Sanjay (c)
Cc: [EMAIL PROTECTED]
Subject: Re: Members of SessionBeans in JSP


"Radhakrishnan, Sanjay (c)" wrote:

> Accoring to my understanding Data Members of SessionBeans in JSP should be
> serializable. So ResultSet and Connection Objects cannot be Members of
> Session Beans.  Am i right in Saying that?
>

Per the 2.2 servlet spec, the objects you store in a session bean must be
serializable only if your application is marked distributable (i.e. it can
run in
more than one JVM at the same time).  Otherwise, it is optional.

>
> Yet when i include resultset objects as members of session beans, the
> resultset(inside a sessionbean) created by one page are accessible thru
> another page(Both pages make use of the Bean tag).  I am assuming that
> Jrun(which i use) employs serialization to achieve this.
>

Serialization is not required for this -- instead, the session data objects
are
shared between all the JSP pages and servlets in the application.  It is the
same
ResultSet instance, so no copying is required.

>
> How is that possible if Resultsets are not serializable.
>
> Appreciate your inputs
>

There is a different reason, though, that I would recommend against storing
ResultSets in user sessions even though it works.  It has to to with the
scalability of your application.

Storing the result set in the session implies that it is going to remain
there
across requests from the user (otherwise you might as well store it as a
request
attribute).  To be usable in a subsequent request, the ResultSet must remain
open,
which implies that the corresponding Statement that created it must remain
open,
which implies that the database connection which created this Statement must
remain
allocated to this user.  (You can get away with sharing a connection across
multiple users in a read only environment, but transactional COMMIT and
ROLLBACK
commands will cause interference if you are updating things.)  This means
that you
need an available connection for each simultaneous user, even if that user
just
took off for lunch.

The recommended approach to scalability is to use a connection pool, and
(within a
single request), always give back the connection you were using before you
return
the result page to the user.  The implication for this discussion is that
you
should copy the result data you need to keep into some Java object of your
own
(maybe a Vector full of beans that contain a bean per row or something like
that),
so that you can close the result set (and the associated statement, and
release the
connection) before returning the page.

Using this approach, the number of database connections you have only limits
the
number of simultaneous requests you can handle, instead of the number of
users
currently logged on to your applicaiton.  Depending on how active the users
are,
these two numbers can be *substantially* different.

>
> Sanjay
>

Craig McClanahan

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Members of SessionBeans in JSP

2000-01-05 Thread Radhakrishnan, Sanjay (c)

Accoring to my understanding Data Members of SessionBeans in JSP should be
serializable. So ResultSet and Connection Objects cannot be Members of
Session Beans.  Am i right in Saying that?

Yet when i include resultset objects as members of session beans, the
resultset(inside a sessionbean) created by one page are accessible thru
another page(Both pages make use of the Bean tag).  I am assuming that
Jrun(which i use) employs serialization to achieve this.

How is that possible if Resultsets are not serializable.

Appreciate your inputs

Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Re: JSP developer tool

2000-01-05 Thread Radhakrishnan, Sanjay (c)

I may be wrong, but Forte for Java does not have a HTML Page builder. It has
a JSP and Servlet Builder

Sanjay

-Original Message-
From: Walter Bauer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 05, 2000 9:57 AM
To: [EMAIL PROTECTED]
Subject: Re: JSP developer tool


Look at Forte for Java (www.netbeans.com) - a complete development
environment
with JSP and Servlet support (check for the internet moduls as well).

Best regards,
Walter

Michael Parcewski wrote:

> Visual Slickedit one of the best tools I've used for JavaServelets and
JSP,
> check it out at www.slickedit.com, it has strong HTML and Java Syntax
> Support and is available both for windows and linux.
>
> - Original Message -
> From: Høye Pål <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, December 29, 1999 7:10 AM
> Subject: JSP developer tool
>
> > I have programmed XML using JSP for some time now using TextPad. I
wonder
> if
> > there is anybody who has a recommendation for a good JSP developing
tool.
> I
> > know Oracle's JDeveloper and IBM's WebSphere Studio has JSP support, but
I
> > am not happy with them. They give help on the HTML syntax and some (not
> all)
> > of the JSP syntax, but the do not support the Java code inside the JSP
> > itself.
> >
> > I will be happy for recommendations.
> >
> >
> > Pål Høye
> > Systemutvikler
> > Merkantildata Applikasjon AS
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > FAQs on JSP can be found at:
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Off Topic: JConnect and Updatable result sets

2000-01-04 Thread Radhakrishnan, Sanjay (c)

We are using a Sybase database in our application(which uses JSPs). JConnect
is the JDBC driver from Sybase. Jconnect 5.2 claims that it is compliant
with JDBC 2.0, but does not fully implement scrollable resultsets and even
the Updatable resulsets doesn't work well either.

In such a scenario, how should one implement scrollable and updatable result
sets.

Do we have to build our own library, may be build a vector object/class
which resembles the resultset and do all data manipulation inside the vector
object and let the Vector generate update statements or Are there any off
the shelf library/product which will do the same thing.

I'm sure most of you guys must have faced this problem.

Appreciate your help

Thanks
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Beans in JSP

2000-01-04 Thread Radhakrishnan, Sanjay (c)

I am trying to encapsulate all my db connection functionality inside a Java
Bean and use that Bean inside my JSPages using the Bean tag.

In some cases if i made the beans as session beans, for some reason i do not
get page's content generated by JSP, instead i get a blank page.

To resolve the issue i had to rename my bean in the bean tag(which
eventually means changing my page) or recycle/restart Jrun(I use Apache &
Jrun). So i wonder if its a problem with Jrun, I think it leaves orphaned
beans/classes around. Have any of you experienced this problem.

Also when is a session bean destroyed, my guess would be when the session is
complete. Am i right

thanks for your time
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Re: offtopic:JavaScript & Security

1999-12-21 Thread Radhakrishnan, Sanjay (c)

Ross,

If i am going to do validation on the frontend and do the same on
the backend/middle tier as well, then im wondering whether i should use
JavaScript at all to do client side validation. In any case if Im going to
do serverside validation then I might as well do the validation only on the
serverside to avoid any overhead on the clientside.

So does all these websites which do ClientSide Validation also do
the same on the ServerSide.

Thanks for your time
Sanjay
-Original Message-
From: Ross Dyson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 21, 1999 11:15 AM
To: Radhakrishnan, Sanjay (c); [EMAIL PROTECTED]
Subject: RE: offtopic:JavaScript & Security


This is a favourite way to hack web sites, when they rely only on Javascript
to secure them.  The user only has to turn off javascript in their browser
to avoid any checking.

You must validate front and back!!  Javascript gives instant feedback only.

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Radhakrishnan, Sanjay (c)
Sent: Tuesday, December 21, 1999 16:14
To: [EMAIL PROTECTED]
Subject: offtopic:JavaScript & Security


We are planning to develop a system for delivering reports over the web.
HTML and JavaScript would be used in doing the frontend interface.

My question to the group is this how secure is JavaScript. I understand that
one of the most common Uses of JavaScript is doing client side validation.
But the problem(it maynot be) that i see with JavaScript is that an
intelligent user can do a view source on the browser change the JavaScript,
and hence could change the validation rule and could enter incorrect data
into the system.

Is this a possibility or am i missing something here.

Thanks for your time

Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



offtopic:JavaScript & Security

1999-12-21 Thread Radhakrishnan, Sanjay (c)

We are planning to develop a system for delivering reports over the web.
HTML and JavaScript would be used in doing the frontend interface.

My question to the group is this how secure is JavaScript. I understand that
one of the most common Uses of JavaScript is doing client side validation.
But the problem(it maynot be) that i see with JavaScript is that an
intelligent user can do a view source on the browser change the JavaScript,
and hence could change the validation rule and could enter incorrect data
into the system.

Is this a possibility or am i missing something here.

Thanks for your time

Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Off topic: Classes in a package?

1999-11-29 Thread Radhakrishnan, Sanjay (c)

I am writing a utility program in java which should do the following. Given
a package name it should display all classes in that package. Is there a way
by which i can do that in java?

Thanks for your time
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Tabbed panes in HTML

1999-10-26 Thread Radhakrishnan, Sanjay (c)

I am trying to create a couple of pages with JSP for one of the pilot
projects.  I am trying to create tabbed panes in my html page. For example
if you take a look at cicuitcity.com the main page has a lot of tabs which
are actually gifs. Clicking on a tab(or gif) brings up a different page
which sort of simulates the effect that its a tab control.

My question is this does anybody know if i can get readymade gifs which can
be used in the same way described above. I am not a Graphic designer and i
really do not want to spend time designing gifs.

Probably i should be asking this question to a HTML user group. But i
thought this would be a good place to start since my project involves Java
Server Pages.

Thanks for your time
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html