We need a DMI to kick off a long running task. This task can take anywhere from 5 to 60 minutes (interfacing with external devices). Our first work-around was to increase the RPC timeout value to 60 minutes. Not a good solution. A better solution is have the DMI start an asynchronous task and return. The asynchronous task will need to perform some database updates which must behave as transactions (all or nothing) as well as database reads. However, since the DMI kicks off the task and returns a success to the client indicating the asynchronous task was started, the task no longer has access to the RPCManager for interacting with database.
We have been looking into following options but have not yet attempted to implement any of them yet.
* Standalone DataSources - It's not clear if this would work since the task is running inside the server code and not a true stand-alone application
* Writing embedded SQL or stored procedures to perform the database operations. Defeats the beauty of DataSources.
* Researching how SQLDataSource.getSQLClause() and SQLConnectionManager.getConnection() could be used. with a DataSource?
Does anyone have any suggestions on how to easily (via a DataSource ideally) call a DMI which launches an asynchronous task which perform database actions (read/write) and have the DMI return before the task is complete. I guess the real question is how to perform database reads and transactions from task (java runable) launched from a DMI? Any ideas would be greatly appreciated.
Thanks.
We have been looking into following options but have not yet attempted to implement any of them yet.
* Standalone DataSources - It's not clear if this would work since the task is running inside the server code and not a true stand-alone application
* Writing embedded SQL or stored procedures to perform the database operations. Defeats the beauty of DataSources.
* Researching how SQLDataSource.getSQLClause() and SQLConnectionManager.getConnection() could be used. with a DataSource?
Does anyone have any suggestions on how to easily (via a DataSource ideally) call a DMI which launches an asynchronous task which perform database actions (read/write) and have the DMI return before the task is complete. I guess the real question is how to perform database reads and transactions from task (java runable) launched from a DMI? Any ideas would be greatly appreciated.
Thanks.
Comment