struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/util GenericDataSource.java
Date Thu, 21 Mar 2002 23:22:46 GMT
craigmcc    02/03/21 15:22:45

  Modified:    src/share/org/apache/struts/util Tag: STRUTS_1_0_BRANCH
                        GenericDataSource.java
  Log:
  Synchronize execution of open() to avoid problems if two or more threads
  call getConnection() on a new GenericDataSource instance at the same time.
  
  PR: Bugzilla #5008
  Submitted by:	Philip Smith <philip0530 at yahoo.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.3   +6 -7      jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java
  
  Index: GenericDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java,v
  retrieving revision 1.5.2.2
  retrieving revision 1.5.2.3
  diff -u -r1.5.2.2 -r1.5.2.3
  --- GenericDataSource.java	10 Jun 2001 03:36:50 -0000	1.5.2.2
  +++ GenericDataSource.java	21 Mar 2002 23:22:45 -0000	1.5.2.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java,v
1.5.2.2 2001/06/10 03:36:50 craigmcc Exp $
  - * $Revision: 1.5.2.2 $
  - * $Date: 2001/06/10 03:36:50 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java,v
1.5.2.3 2002/03/21 23:22:45 craigmcc Exp $
  + * $Revision: 1.5.2.3 $
  + * $Date: 2002/03/21 23:22:45 $
    *
    * ====================================================================
    *
  @@ -178,7 +178,7 @@
    *
    * @author Craig R. McClanahan
    * @author Ted Husted
  - * @version $Revision: 1.5.2.2 $ $Date: 2001/06/10 03:36:50 $
  + * @version $Revision: 1.5.2.3 $ $Date: 2002/03/21 23:22:45 $
    */
   
   public class GenericDataSource implements DataSource {
  @@ -455,8 +455,7 @@
           // Validate the opened status of this data source
           if (closed)
               throw new SQLException("getConnection:  Data source is closed");
  -        if (driver == null)
  -            open();
  +        open();
   
           while (true) {
   
  @@ -646,7 +645,7 @@
        *
        * @exception SQLException if a database access error occurs
        */
  -    public void open() throws SQLException {
  +    public synchronized void open() throws SQLException {
   
           // Have we already been opened?
           if (driver != null)
  
  
  

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message