Sequence id is not setting properly (oracle)

Hi,

I’ve integrated the scheduler into my app, and it’s not getting the id correctly the first time an event is added. The DDBB is updated, but when I try to modify the new event, it has the random id generated by scheduler. In the DB the id has the value generated by the sequence, but the scheduler doesn’t.

If I do refresh the page (by select command), the scheduler takes the ids correctly, but I don’t want to reload all the events again.

The querys are much more extense, but i’ve reduced them in the code.

SchedulerConnector c = new SchedulerConnector((new DatabaseConnection()).getConnection(), DBType.Oracle);
DBDataWrapper dataWrapper = (DBDataWrapper)c.sql;
dataWrapper.sequence("ABSCHEDULER.PK_COD_EVENT.nextVal");

dataWrapper.attach( OperationType.Insert ,"INSERT INTO EVENTS(COD_EVENT) VALUES(ABSCHEDULER.PK_COD_EVENT.nextVal)");

c.render_sql("SELECT C.COD_EVENT,P.COD_PERSON FROM ABSCHEDULER.EVENTS C" +
					"LEFT OUTER JOIN ABSCHEDULER.PERSONS ON (C.COD_CITA = P.COD_PERSON)","COD_EVENT,COD_PERSON");

Thanks.

Instead of auto-generated queries , you are using custom inserting call.
As result, component is not able to detect ID of newly added record, which causes incorrect behavior.

Try to use the attached jar , instead of the original one. It was updated to fetch correct ID for custom queries.
dhtmlxconnector.zip (109 KB)

Thank you so much. It works :wink: