Reply from Howler_Fish on Apr 30 at 11:25 PM There are two types of temporary tables. Type 1 - the most common A normal SQL table keyed on process instance, there is only one instance of this table in the database. If three app engines run at the same time, they insert their data under the key of their own process instance and co-exist happily. Type 2 - the old shared model You declare one table, and tell the database how many times you want to use it in parallel by listing it as a temp table attached to the app engine. When you build the table, AppDesigner polls how many concurrent instances of table it might need and builds The table you would expect PS_MY_TMP_TBL Multiple copies with a number suffix (so if it needs 3 copies) CREATE TABLE PS_MY_TMP_TBL01 blah bah CREATE TABLE PS_MY_TMP_TBL02 blah blah CREATE TABLE PS_MY_TMP_TBL03 blah blah When you run the app engine, it goes off to a temp table manager and asks for the next free temp table instance. That app engine then has exclusive access to that temp table. Type 2 has the advantage that you can issue global commands without worrying about another app engine manipulating / relying on the data. Suppose you had two instances of the same report running, with different parameters. One might be trying to insert data while the other is issuing a TRUNCATE command, or an UpdateStats. This approach has the disadvantage that if the AppEngine abends and does not restart, the temp table is locked until you remember to go in and release it. Type 1 is the quickest to set up and so is the most prevalent in my experience.
| | | ---------------Original Message--------------- From: Ken Duncan Sent: Monday, April 30, 2012 10:43 PM Subject: Temporary Tables in App Engine Program As a followup-up to a previous question about turning a stored procedure into temp tables in an App Engine program, I read through the App Engine book, and looked at the few tiny references to temporary tables in the PeopleCode Language Reference PeopleBook. According to the App Engine book, a temp table needs to be defined before it is used in the App Engine program. So I went looking for examples. I found only six delivered "Temporary Table"s in Campus Solutions 9.0 (based upon looking for a Record of type "Temporary Table" in App Designer) and none of them looked like something campus-related. If these are supposed to be defined ahead of time, why are there not fifty, one hundred, or more of these in the delivered product, with lots of code to look at to see how to use them? What am I missing here? Thanks. Ken | | Reply to this email to post your response. __.____._ | _.____.__ |
No comments:
Post a Comment