4D v14Execute on Server attribute |
||
|
4D v14
Execute on Server attribute
Execute on Server attribute
The "Execute on Server" project method attribute can be set using the batch setting of attributes dialog box as well as the Method Properties dialog box: When this option is checked, the project method is always executed on the server, regardless of how it is called. Note: This attribute is only taken into account for a 4D application in client/server mode. When this attribute is checked, the execution context of the project method is comparable to that of triggers (see 4D Server and the 4D Language): the method on the server shares the same database context as the corresponding context on the client side for locking records and for transactions, but not the same language context (process variables, sets, current selections). However, unlike a trigger, a method executed on the server does not share the current record with the client context. Unlike the Execute on server command, this option does not create a process on the server. 4D Server uses the "twin" process of the client process that requested the execution. Methods that have the "Execute on Server" attribute are subject to the same rules as the stored procedures as far as the use of 4D language commands is concerned. Executing certain commands is not allowed on the server, executing others is not recommended. For more information, please refer to the "What a stored procedure does not do (executed on the server)?" paragraph in the Stored Procedures section. If you pass a pointer to a variable (simple variable, array or array element), the pointed value is also sent to the server. If the pointed value is modified on the server by the method, the modified value is returned to the client in order to update the corresponding variable on the client side. Note: This option works the same way in interpreted mode as in compiled mode. Here is the code for the Myappli project method which has the "Execute on Server" attribute: C_POINTER($1) `Pointer to table On the client side, the method is called as follows: ARRAY TEXT(myArray;0) |
PROPERTIES
Product: 4D ARTICLE USAGE
4D Server Reference ( 4D v13) Parent of : Execute on Server attribute ( 4D Server v11 SQL Release 6) |