Hi Pramod,
The changes look good.
-Tom
Pramod Gopinath wrote:
>Hi Tom
> The code change attached to this email deals with resolving issue: 805
>https://glassfish.dev.java.net/issues/show_bug.cgi?id=805
>
>This issue is relevant only to Postgresql database.
>
>Currently if the user has a table defined in a schema other than the
>default schema (public), then the following error is thrown :
>============================================
>Local Exception Stack:
>Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.6 (Build
>060630)):
>oracle.toplink.essentials.exceptions.DatabaseException
>
>Internal Exception: org.postgresql.util.PSQLException: ERROR: relation
>"public.address_id_seq" does not
>existError Code: 0
>Call:select currval(current_schema()|| '.address_id_seq')
>============================================
>
>When I defined the PostgreSQLPlatform, I had defined the method
>buildSelectQueryForNativeSequence(String seqName, Integer size)
>which would try to get the last value from the sequence using the call :
>select currval(current_schema()" + "|| \'." + seqName + "\')");
>
>This is incorrect. There could be cases where the user might create
>entities in other schema's. So logically the user might have a
>connection to schema "public" and try to lookup entities that are in
>some other schema. But the call for current_schema() would incorrectly
>look for the sequence in the "public" schema. Hence I am removing the
>call to "current_schema()" and the user would have to ensure that they
>have correctly provided the fully qualified sequence name.
>
>Thanks
>Pramod
>
>
>
>
--
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com