Hello,

I am a bit confused about schemas and cache names.  In some cases they seem 
synonymous, on others the appear different.

So far I have defined everything in XML configuration. To execute a query, I 
get the cache [getOrCreateCache()], and then execute the query statement. When 
the statement joins to another table, I prefix the cache name to the other 
table. So far, so good.

Now, I want to create a table using SQL. From the doc I understand that I need 
to set the schema in the query [setSchema("PUBLIC")].

Q1: Can I do this on any cache (opened)?

Q2: Is there any other use for [setSchema("PUBLIC")]? 
For example, when I have the PersonCache open, can I set the schema to 
OrganizationCache, so that I can query the Organization table without prefixing 
the cache name?

If Q2 is yes, then Schema and CacheName seem to be synonymous for configuration 
created tables.
But they are not for SQL created tables (per doc the cache name will be 
SQL_{SCHEMA_NAME}_{TABLE}.

Q3: Then, is there also a "PUBLIC" cache? If yes, can I get that cache 
[getOrCreateCache("PUBLIC")]?

If Q3 is no, then (presumably) I need at least one cache before I can create a 
table using SQL.

Q4: In cross-cache queries, I always use CacheName as the prefix, correct?
This is really where the confusion comes from, because typically it would be a 
schema that is prefixed to the table.

Thanks...

Roger



Reply via email to