New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table not found although metadata successfully fetched #1055
Comments
@kidharbachan it is hard to tell why looking at your logs. However, I think the reason is probably that your servers might use connections to the DB with different permissions - one can pull metadata, one cannot. Can you provide all log statements related Also, by default you are using Runtime Discovery feature, the one that queries the database for the structure at runtime (finds tables, relationships, etc). However, there is a second method: Static Discovery. If you use this method, the schema discovery will be processed at build time, and the file with schema metadata will be automatically packed into your app. This way, ActiveJDBC will not be performing any runtime discovery. It is important to understand that your local database for the build must have the same structure as production (obviously). |
@ipolevoy I have confirmed that the user and permissions are exactly the same between working and non-working cases. I have attached the working and non-working cases log files. |
@kidharbachan this:
is telling me that in the same process, you have metadata discovery happening in multiple threads at the same time. This is might cause some race conditions. Please, try changing code to run a simple SQL before you start multithreaded processes, as this will ensure that the discovery will not be trampling each other. If you do not want to change any code, I suggest you use the static discovery as suggested above: #1055 (comment) |
Thank you for your input @ipolevoy |
@kidharbachan did you resolve your prod issue? |
@ipolevoy We are still checking howto make only one call to init function. We will let you know if that resolves the issue. |
@ipolevoy we found that the table was being created twice in the code. Removing the duplicate resolved the issue. |
@kidharbachan I'm glad your issue is resolved. Can you please explain how a table is created "in code". Are you using some kind of a migration mechanism? |
Ah, got it. Glad you sorted things out! |
I am currently using activejdbc-2.2 in a JBoss 6.4.5 AS in a 2 server domain. Both servers are connecting to the same datasource and we have verified that the table does exist in the db and the user is the owner of the database.
Server 1 works as expected.
Server 2 fails to find a table that was successfully registered at startup - it ALWAYS fails.
I have pasted the relevant log lines below as well as the exception.
Can you point me in a direction on what to check for next?
...
...
...
..
21:47:05,063 INFO [org.javalite.activejdbc.LazyList] (DefaultQuartzScheduler-estatements.batch_splitter.camel-1_Worker-7) {"sql":"SELECT * FROM property_group WHERE (NODE_ID IS NULL OR NODE_ID=?) AND NAME=?","params":[5,"pdf"],"duration_millis":1,"cache":"miss"}
21:47:05,066 INFO [org.javalite.activejdbc.LazyList] (DefaultQuartzScheduler-estatements.batch_splitter.camel-1_Worker-7) {"sql":"SELECT * FROM property WHERE propertyGroup_Id IN (?) ORDER BY id","params":[2],"duration_millis":3,"cache":"miss"}
The text was updated successfully, but these errors were encountered: