| Senthoorkumaran Punniamoorthy 2005-07-19, 8:24 pm |
| Thanks for responding. However the problem with using this approach
would be since we are using container managed transaction and
persistance (CMP) the application doesnt have control over how the
SQLs are issued and executed. All managed by Jboss. In situations like
this what could be a viable alternative?
Regards,
Senthoor
On 7/19/05, im i <linimi@gmail.com> wrote:
> Hi,
>
> (Sorry my english.)
>
> I think, the problem is not in query. There is other statement what
> corrupt the transaction before query, example insert or update. The
> postgres 8. solve the problem with savepoint, you can create savepoint
> before critical statement and when error occured you need rollback to
> savepoint:
>
> http://www.postgresql.org/docs/8.0/...-savepoint.html
>
> When you catch exception then the transaction is corrupt alredy.
>
> try {
> savepointName = this.getClass().getName() + "-" +
> this.getClass().hashCode();
> savePoint = conn. setSavepoint(savepoi
ntName);
> stmt.execute();
> } catch (SQLException sqle) {
> conn. rollback(savePoint);
> }
>
> linimi
>
> On 7/19/05, Senthoorkumaran Punniamoorthy <senthoor@gmail.com> wrote:
>
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
|