bloritsch    01/05/04 13:18:48

  Modified:    src/org/apache/cocoon/reading Tag: xml-cocoon2
                        DatabaseReader.java
  Log:
  oops.  I tested a version before the one I committed.....
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.17  +15 -7     
xml-cocoon/src/org/apache/cocoon/reading/Attic/DatabaseReader.java
  
  Index: DatabaseReader.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon/src/org/apache/cocoon/reading/Attic/DatabaseReader.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- DatabaseReader.java       2001/05/04 19:43:07     1.1.2.16
  +++ DatabaseReader.java       2001/05/04 20:18:42     1.1.2.17
  @@ -17,6 +17,7 @@
   import java.sql.SQLException;
   import java.sql.Timestamp;
   import java.util.Date;
  +import java.util.Map;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -26,6 +27,7 @@
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.excalibur.datasource.DataSourceComponent;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
  @@ -38,6 +40,7 @@
   import org.apache.cocoon.caching.NOPCacheValidity;
   import org.apache.cocoon.caching.TimeStampCacheValidity;
   import org.apache.cocoon.util.HashUtil;
  +import org.xml.sax.EntityResolver;
   import org.xml.sax.SAXException;
   
   /**
  @@ -147,7 +150,8 @@
           int contentLength = 0;
   
           try {
  -            return this.serialize(object, response);
  +            Response response = (Response) 
objectModel.get(Constants.RESPONSE_OBJECT);
  +            return this.serialize(response);
           } catch (IOException ioe) {
               getLogger().debug("Assuming client reset stream");
   
  @@ -231,9 +235,9 @@
               throw new SQLException("The Blob is empty!");
           }
   
  -        InputStream is = new BufferedInputStream(object.getBinaryStream());
  +        InputStream is = new 
BufferedInputStream(this.resource.getBinaryStream());
   
  -        int contentLength = (int) object.length();
  +        int contentLength = (int) this.resource.length();
           long expires = parameters.getParameterAsInteger("expires", -1);
   
           if (expires > 0) {
  @@ -284,10 +288,14 @@
           this.lastModified = 0;
   
           if (this.con != null) {
  -            if (this.doCommit) {
  -                this.con.commit();
  -            } else {
  -                this.con.rollback();
  +            try {
  +                if (this.doCommit) {
  +                    this.con.commit();
  +                } else {
  +                    this.con.rollback();
  +                }
  +            } catch (SQLException se) {
  +                getLogger().warn("Could not commit or rollback connection", 
se);
               }
   
               try {
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to