Community
Participate
Working Groups
If you defined a sqldatasource in a library like below: ads SQLDataSource?{@Resource {bindingkey = "mvclib", propertyFileName = "aProject"}}. You can't use the "ads" in functions of the library. But if it was defined in the function of library. It can be used to do database action. I debug it , and find out the ads is NULL, if defined as a field of library.
If you define a SQLDataSource in a Service, it is initialized with the annotation values. However, the same code, if put in a Library, does not have the initialization. It will through an exception when the ds is used.
---EGL code--- library DBLib ds SQLDataSource?{@Resource {bindingKey = "aaa"}}; function getPosts() end end ---Generated Java code--- public class DBLib extends ExecutableBase { private static final long serialVersionUID = 10L; @javax.xml.bind.annotation.XmlTransient public transient SQLDataSource ds; public DBLib() { super(); ezeInitialize(); } public void ezeInitialize() { ds = null; } ..... ---Generated Java code if it is a Service---- public class DBService extends ServiceBase { private static final long serialVersionUID = 10L; @org.eclipse.edt.javart.json.Json(name="ds", clazz=SQLDataSource.class, asOptions={}) public transient SQLDataSource ds; public DBService() { super(); ezeInitialize(); } public void ezeInitialize() { ds = org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeCast(SysLib.getResource("aaa"), SQLDataSource.class); }
duplicate *** This bug has been marked as a duplicate of bug 363691 ***
Verify against EGL Web Developer Tools 0.7.0.v201111221542, close it