Wiki source code of Session.java Addition

Version 2.1 by David Avendasora on 2008/03/06 09:43

Show last authors
1 These additions are based on a more advanced Stateless RMI concept by Florijan Stamenkovic.
2
3 {{color value="red"}}
4 WARNING:
5 {{/color}}
6
7 You cannot call Model-defined FetchSpecifications from the client-side that use a Raw SQL Expression without implementing the delegate method [[distributionContextShouldFetchObjectsWithFetchSpecification>>http://developer.apple.com/documentation/MacOSXServer/Reference/WO54_Reference/com/webobjects/eodistribution/EODistributionContext.Delegate.html]].
8
9 If you try, you will get the following exception:
10
11 {{color value="red"}}
12 Server exception: The fetchSpecification YourFetchSpecificationWithRawSQLExpression was not allowed to execute on the server. If your application needs to execute this method, the security needs to be relaxed by implementing the delegate method distributionContextShouldFetchObjectsWithFetchSpecification
13 {{/color}}
14
15 {{code}}
16
17 public EOFetchSpecification clientSideRequestGetFetchSpecification(String fetchSpecification, String entity) {
18 return getFetchSpecification(fetchSpecification, entity);
19 }
20
21 public EOFetchSpecification getFetchSpecification(String fetchSpecification, String entity){
22 try{
23 return EOFetchSpecification.fetchSpecificationNamed(fetchSpecification, entity);
24 }catch(Exception ex){
25 NSLog.out.appendln(ex);
26 return null;
27 }
28 }
29
30 {{/code}}