Results 1 to 6 of 6
  1. #1
    Marty is offline Member
    Join Date
    May 2007
    Posts
    38
    Rep Power
    0

    Default Servlets and threads.

    Hi everybody, I have a doubt respect to the synchronization in database access from servlet, ..but this servlet is multithread,Do I have to synchronizate the database access? o is the container (tomcat) that do this?

    thank you !!
    Marty
    Last edited by Marty; 06-01-2007 at 04:19 PM.

  2. #2
    levent Guest

    Default

    Isn't database synchronized itself? At the end it will not allow multiple writes to a data.

  3. #3
    Alan is offline Member
    Join Date
    May 2007
    Posts
    39
    Rep Power
    0

    Default

    You have to create a pool connections
    Anyway, I don't understand why do you should synchronizate. A RDBM
    can manipulate n numbers of connections without problems.
    To synchronize the threads means that you have to force some to wait.

    mm follow the steps that other did it.
    Please check this site

    The Apache Tomcat 5.5 Servlet/JSP Container - JNDI Datasource HOW-TO
    Last edited by Alan; 06-01-2007 at 02:44 AM.

  4. #4
    Marty is offline Member
    Join Date
    May 2007
    Posts
    38
    Rep Power
    0

    Default

    thanks guys

  5. #5
    henry_78 is offline Member
    Join Date
    Aug 2007
    Posts
    47
    Rep Power
    0

    Default

    Hi,
    I think u can use the Isolation property of a connection to solve the syncronization problem.
    Try this: your_connection_name.setTransactionIsolation(TRANS ACTION_SERIALIZABLE);

  6. #6
    gsahoo is offline Member
    Join Date
    Aug 2007
    Posts
    1
    Rep Power
    0

    Default New Member

    Hi Every buddy,

    Today I am joined in Java Forums Family.

    Thanks
    :)

Similar Threads

  1. Servlets with J2ME
    By Daniel in forum CLDC and MIDP
    Replies: 2
    Last Post: 05-27-2008, 06:56 PM
  2. Java Servlets
    By kondalrao in forum Java Servlet
    Replies: 0
    Last Post: 04-14-2008, 12:12 PM
  3. servlets or jsp
    By krishnapal in forum Advanced Java
    Replies: 1
    Last Post: 12-13-2007, 03:31 PM
  4. Servlets
    By nagaroopanandha in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 03:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •