Yes, as we mentioned, you must load the Customer DataSource before audit_Customer.
Two script tags are executed as two parallel requests by the browser, so your first request will fail.
Note also that when using <script src=> tags with DataSourceLoader, you want to combine as much as you can, as that's much more efficient.
Announcement
Collapse
No announcement yet.
X
-
Figured it out, switched this:
Code:<script src="admin/sc/DataSourceLoader?dataSource=Customer"></script> <script src="admin/sc/DataSourceLoader?dataSource=audit_Customer"></script>
Code:<script src="admin/sc/DataSourceLoader?dataSource=Customer,audit_Customer"></script>
Leave a comment:
-
OK, at this point, you're saying you're doing exactly what is shown working in the sample, and it just doesn't work. This is a good time to be checking for silly errors, like having updated the code and accidently retesting before having actually saved, or changing the code in one project but accidentally testing in another project - that kind of thing.
Then, if you need further help with this, as noted in the error message itself, we'll need to see the rest of the log, not just the partial stack trace. Note it's best to just proactively provide this, so time isn't wasted asking for basic diagnostics.
Leave a comment:
-
Yes, this is an existing application with already functioning data sources. I added loading the audit_Customer data source right after the Customer data source.
Leave a comment:
-
As mentioned above, you also need to load the "Customer" DataSource in order to load its audit DataSource. Did you do that?
Leave a comment:
-
I added the "audit_Customer" data source to our index page to load it, that throws an error on the server when loading:
Code:javax.servlet.ServletException: DataSource 'audit_Customer' failed to load due to an exception on the server: Unable to load DataSource for ID: audit_Customer See the server-side log for additional details. at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:215) at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:112) ...
Leave a comment:
-
DataSource.get() does not cause a DataSource to be loaded, so most likely, you simply didn't load the audit DataSource. DataSource.load(), or use of the DataSourceLoader servlet, is the way to do that.
Also, as the docs note, the main DataSource must be loaded before attempting to retrieve an automatically created audit DataSource. So make sure you are also loading the "Customer" DataSource.
Leave a comment:
-
Loading Audit Datasource
Version: Isomorphic SmartClient/SmartGWT Framework (v13.0p_2023-10-12/Enterprise Deployment 2023-10-12)
I'm trying to use the automatic auditing feature. I have a SQL datasource where I added audit="true":
Code:<DataSource ID="Customer" serverType="sql" tableName="customer" audit="true">
Code:DataSource.get("audit_Customer")
I don't see anything else declared to query the audit table. Is there something I'm missing?
Thanks!Tags: None
Leave a comment: