synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiranya Jayathilaka (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SYNAPSE-457) allow dbreport mediator to have a result
Date Mon, 20 Sep 2010 11:36:33 GMT

    [ https://issues.apache.org/jira/browse/SYNAPSE-457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912442#action_12912442
] 

Hiranya Jayathilaka commented on SYNAPSE-457:
---------------------------------------------

There are actually multiple problems to be addressed here:

1. There is no one standard way which works on all database management systems for getting
the last insert ID
2. Transactionality
3. Different users will want to get different return values (some will want the last insert
ID, some will want the number of records inserted etc)

One solution is to introduce something like a post-DBreport hook. This is a special user defined
query which is executed immediately after the SQL insert/update. The return value can be set
on the message context as a property. I will look into this in the near future. 

But IMO this is definitely 2.1 material.



> allow dbreport mediator to have a result
> ----------------------------------------
>
>                 Key: SYNAPSE-457
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-457
>             Project: Synapse
>          Issue Type: Improvement
>    Affects Versions: 1.2
>            Reporter: harm verhagen
>            Assignee: Hiranya Jayathilaka
>
> Feature request.
> allow dbreport to also have return values (result).
> reason:
> Currently there is no clean (threadsafe) way to obtain the ID of a newly created row
in a table. (id is an AUTO_INCREMENT table value).
> There are functions to obtain the last ID (mysql: LAST_INSERT_ID() ) But these work _only_
in the same transaction. (so in the _same_ dbreport mediator, as where the insert happens)
> For more elaborate problem description see:
> http://wso2.org/mailarchive/esb-java-user/2008-October/000935.html
> proposed solution (indika at wso2.com )
> http://wso2.org/mailarchive/esb-java-user/2008-October/000937.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message