timer - PostgreSQL and Glassfish EJB__TIMER__TBL table -
i'm trying utilize timer service provided glassfish. thus, have create table named ejb__timer__tbl
, configure jdbc resource in glassfish.
i want store table on postgresql on schema named glassfish
. ddl 1 (i replace blob
type bytea
) :
create schema glassfish; create table glassfish.ejb__timer__tbl ( creationtimeraw bigint not null, blob bytea, timerid varchar(255) not null, containerid bigint not null, ownerid varchar(255) null, state integer not null, pkhashcode integer not null, intervalduration bigint not null, initialexpirationraw bigint not null, lastexpirationraw bigint not null, schedule varchar(255) null, applicationid bigint not null, constraint pk_ejb__timer__tbl primary key (timerid) ); drop role if exists glassfish; create role glassfish noinherit login password '...'; revoke privileges on tables in schema glassfish glassfish; revoke privileges on functions in schema glassfish glassfish; grant usage on schema glassfish glassfish; grant select, insert, update, delete on tables in schema glassfish glassfish; grant execute on functions in schema glassfish glassfish; grant usage on sequences in schema glassfish glassfish; alter user glassfish set search_path 'glassfish';
i configured jdbc pool , resource glassfish :
asadmin create-jdbc-connection-pool --datasourceclassname org.postgresql.ds.pgconnectionpooldatasource --restype javax.sql.connectionpooldatasource --property user=glassfish:password=...:portnumber=5432:databasename=...:servername=localhost jdbc/simpool/glassfish asadmin create-jdbc-resource --connectionpoolid jdbc/simpool/glassfish jdbc/sim/glassfish
and come in jdbc/sim/glassfish
in jdbc resource utilize timer service in glassish gui.
each time deploy app, receive exception :
[#|2013-02-18t11:42:42.562+0100|warning|glassfish3.1.2|org.eclipse.persistence.session.file :/e:/softs/serveurs/glassfish3_1122/glassfish/domains/domain1/applications/ejb-timer-service-app/web-inf/classes/___ejb__timer__app|_threadid=58;_threadname=thread-2;|local exception stack: exception [eclipselink-4002] (eclipse persistence services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.databaseexception internal exception: org.postgresql.util.psqlexception: erreur: la relation « ejb__timer__tbl » n'existe pas position : 193 error code: 0 call: select "timerid", "applicationid", "blob", "containerid", "creationtimeraw", "initialexpirationraw", "intervalduration", "lastexpirationraw", "ownerid", "pkhashcode", "schedule", "state" "ejb__timer__tbl" (("ownerid" = ?) , ("state" = ?)) bind => [2 parameters bound] query: readallquery(name="findtimersbyownerandstate" referenceclass=timerstate sql="select "timerid", "applicationid", "blob", "containerid", "creationtimeraw", "initialexpirationraw", "intervalduration", "lastexpirationraw", "ownerid", "pkhashcode", "schedule", "state" "ejb__timer__tbl" (("ownerid" = ?) , ("state" = ?))") @ org.eclipse.persistence.exceptions.databaseexception.sqlexception(databaseexception.java:333) @ org.eclipse.persistence.internal.databaseaccess.databaseaccessor.basicexecutecall(databaseaccessor.java:644) @ org.eclipse.persistence.internal.databaseaccess.databaseaccessor.executecall(databaseaccessor.java:535) @ org.eclipse.persistence.internal.sessions.abstractsession.basicexecutecall(abstractsession.java:1717)
so table ejb__timer__tbl
doesn't seem accessible glassfish.
when create project, configure persistence.xml
file same credentials pooled connexion above , create simple query select count(*) ejb__timer__tbl
, receive 0
connexion established , default schema accessed glassfish
espected.
in ${glassfish_root}\glassfish\lib\install\databases
there ddls neither postgresql...so doing wrong ?
nb: when test configure service timer mysql jdbc resource, it's work...
thanks help
ok found solution of problem.
i didn't know sql can case sensitive
. glassfish calls select ... "ejb__timer__tbl"
double quotes have create table named "ejb__timer__tbl" not "ejb__timer__tbl" or else.
the workaround recreate table double quotes :
create table glassfish."ejb__timer__tbl" ( "creationtimeraw" bigint not null, "blob" bytea, "timerid" varchar(255) not null, "containerid" bigint not null, "ownerid" varchar(255) null, "state" integer not null, "pkhashcode" integer not null, "intervalduration" bigint not null, "initialexpirationraw" bigint not null, "lastexpirationraw" bigint not null, "schedule" varchar(255) null, "applicationid" bigint not null, constraint "pk_ejb__timer__tbl" primary key ("timerid") );
postgresql timer glassfish
No comments:
Post a Comment