Hi,

> Should I be concerned with the CACHED/MEMORY option in your opinion?

If you are not sure how large the table will be, use CACHED. I will
probably make that the default in a future release (but not now).

> I am actually running into issues in our testsuite if I try to specify
> CACHED (the table is not found after creation).  Perhaps CACHED here
> wont work if using an in-memory DB?  H2 throws no exception and gives
> no warnings though...

That's strange, what kind of issues?

> GLOBAL temp tables... Do they maintain which session/connection inserted rows?

No. Now that I read the Oracle documentation, I see H2 behaves
differently... I didn't know about that (and nobody told me about this
so far). Unfortunately it will take some time until I can fix this.

> Any suggestions?

I see the problem. I think there are two workarounds:

A) Create a global temporary table (using a different connection) with
a unique name (for example using the session id as the unique name,
you get that using "call session_id()".

B) Create a global temporary table and a temporary view with one more column:

create cached global temporary table temp(
  session_id int default session_id(),
  id int, name varchar(255),
  primary key(id, session_id));
insert into temp(id, name) values(1, 'Hello');
select * from temp where session_id = session_id();

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to