Julia, I merged this in this morning, and said as much.  You probably
missed it in the list turn around time.  Please let us know if a
similar patch is necessary for deleteAll().

Thanks, Daniel


Julia Stobbe <[EMAIL PROTECTED]> writes:

> hi again,
> sorry about the repost, but nobody replied ...
> i think this is essential for postgresql when working with the
> turbine-user classes
> 
> 
> repost:
> hi,
> there was a little oversight when adding transaction support for postgresql.
> 
> doDelete was overlooked, so it returns the cryptic FastPath Call Error -
> postgres can deal with LOBs only in transactions..
> 
> i do not know whether BasePeer.deleteAll (String table, String column,
> int value)
> 
> should be "fixed" - could only work with the default database. if it
> makes sense, i
> 
> will send a patch
> 
> the diff below was generated with -w, i hope, you can use  it the way it is
> (got totally useless diffs without it - is there a lot of whitespaces
> in the sources?)
> 
> 
> Julia
> 
> Index: ./peer/BasePeer.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/om/peer/BasePeer.java,v
> 
> retrieving revision 1.63
> diff -w -u -r1.63 BasePeer.java
> --- ./peer/BasePeer.java      2001/05/23 15:12:05     1.63
> +++ ./peer/BasePeer.java      2001/06/08 16:48:54
> @@ -459,6 +459,26 @@
>       public static void doDelete(Criteria criteria)
>           throws Exception
>       {
> +        // Transaction stuff added for postgres.
> +        if (TurbineDB.getDB(criteria.getDbName())
> +            .objectDataNeedsTrans() &&
> +            criteria.containsObjectColumn(criteria.getDbName()))
> +        {
> +            DBConnection dbCon = beginTransaction(criteria.getDbName());
> +            try
> +            {
> +                doDelete(criteria, dbCon);
> +                commitTransaction(dbCon);
> +            }
> +            catch (Exception e)
> +            {
> +                // make sure to return connection
> +                rollBackTransaction(dbCon);
> +                throw e;
> +            }
> +        }
> +        else
> +        {
>           DBConnection dbCon = null;
>           try
>           {
> @@ -471,6 +491,7 @@
>               TurbineDB.releaseConnection(dbCon);
>           }
>       }
> +    }
> 
>       /**
>        * Method to perform deletes based on values and keys in a
> @@ -2191,3 +2212,4 @@
>       }
> 
>   }
> +
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to