A trigger causes a BatchUpdateException

Hi all.
I have a big problem. I need to do a program that insert batch information to
Sybase, Firts I use PreparedStatement but when I send executeBatch() command,
throws a Exception , then I used Statement and I got the same problem.
This problem is caused by a insert trigger configured in the sybase table. Maybe
the driver can't distinguish between update counts from the trigger and insert
java sentence. I dont know.
Anybody have an idea to solve this?
I am using WebLogic 8.1 , jConnect 5.5 and Sybase 11.9.2
I send you the completa message exception and part of my example program.
Error 500--Internal Server Error
java.lang.ClassCastException
     at com.sybase.jdbc2.jdbc.SybStatement.batchLoop(SybStatement.java:1233)
     at com.sybase.jdbc2.jdbc.SybStatement.sendBatch(SybStatement.java:1089)
     at com.sybase.jdbc2.jdbc.SybStatement.executeBatch(SybStatement.java:1056)
     at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeBatch(SybPreparedStatement.java:680)
     at weblogic.jdbc.wrapper.PreparedStatement_com_sybase_jdbc2_jdbc_SybPreparedStatement.executeBatch(Unknown
Source)
     at jsp_servlet.__insertbatch._jspService(__insertbatch.java:322)
     at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
     at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
Thanks for your help.
the code for my jsp program example is :
try {               InitialContext env = new InitialContext();
ds = (DataSource) env.lookup("jdbc/Envios");
} catch(NamingException ne) {
out.println("No pudo obtener conexión a la base de datos: " + ne + "<BR>");
//crea la conexion
cnx = Sql.getCnx(ds, 5000);
Statement stmt = cnx.createStatement();
try{
stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567880','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567881','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
reg = stmt.executeBatch();
}catch(SQLException bue){%>
Error causado por SQLException: <%=bue.getMessage()%>
<%}
//Obtiene los datos enviados por la forma de consulta o
//menú principal
//IdGuia SiglasPlaza FechaEvento Ruta TipoMov ClaveEx NumOR IdTransporte IdEmpleado
String SQL = "INSERT INTO cdHistoria VALUES(?,'MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)";
try{
cnx.setAutoCommit(false);
PreparedStatement st = cnx.prepareStatement(SQL);
st.setString(1,"12345678910");
st.addBatch();
st.setString(1,"12345678911");
st.addBatch();
reg = st.executeBatch();
cnx.commit();
cnx.setAutoCommit(true);
st.close();
for (int i=0;1<reg.length;i++){ %>
Registros agregados: <%=i%>
<% }
}catch(BatchUpdateException sqle){
%>
Error causado por SQLException: <%=sqle.getMessage()%>
<%}catch(SQLException bue){%>
Error causado por SQLException: <%=bue.getMessage()%>
<%}%>

Adrian Morales wrote:
Hi all.
I have a big problem. I need to do a program that insert batch information to
Sybase, Firts I use PreparedStatement but when I send executeBatch() command,
throws a Exception , then I used Statement and I got the same problem.
This problem is caused by a insert trigger configured in the sybase table. Maybe
the driver can't distinguish between update counts from the trigger and insert
java sentence. I dont know.
Anybody have an idea to solve this?Hi. This is a followup from a post to the sybase jdbc group. Have you tried
the latest driver from them? The ClassCast exception is a purely Sybase
driver internal error.
Joe
>
I am using WebLogic 8.1 , jConnect 5.5 and Sybase 11.9.2
I send you the completa message exception and part of my example program.
Error 500--Internal Server Error
java.lang.ClassCastException
     at com.sybase.jdbc2.jdbc.SybStatement.batchLoop(SybStatement.java:1233)
     at com.sybase.jdbc2.jdbc.SybStatement.sendBatch(SybStatement.java:1089)
     at com.sybase.jdbc2.jdbc.SybStatement.executeBatch(SybStatement.java:1056)
     at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeBatch(SybPreparedStatement.java:680)
     at weblogic.jdbc.wrapper.PreparedStatement_com_sybase_jdbc2_jdbc_SybPreparedStatement.executeBatch(Unknown
Source)
     at jsp_servlet.__insertbatch._jspService(__insertbatch.java:322)
     at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
     at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
Thanks for your help.
the code for my jsp program example is :
try {               InitialContext env = new InitialContext();
ds = (DataSource) env.lookup("jdbc/Envios");
} catch(NamingException ne) {
out.println("No pudo obtener conexión a la base de datos: " + ne + "<BR>");
//crea la conexion
cnx = Sql.getCnx(ds, 5000);
Statement stmt = cnx.createStatement();
try{
stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567880','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567881','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
reg = stmt.executeBatch();
}catch(SQLException bue){%>
Error causado por SQLException: <%=bue.getMessage()%>
<%}
//Obtiene los datos enviados por la forma de consulta o
//menú principal
//IdGuia SiglasPlaza FechaEvento Ruta TipoMov ClaveEx NumOR IdTransporte IdEmpleado
String SQL = "INSERT INTO cdHistoria VALUES(?,'MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)";
try{
cnx.setAutoCommit(false);
PreparedStatement st = cnx.prepareStatement(SQL);
st.setString(1,"12345678910");
st.addBatch();
st.setString(1,"12345678911");
st.addBatch();
reg = st.executeBatch();
cnx.commit();
cnx.setAutoCommit(true);
st.close();
for (int i=0;1<reg.length;i++){ %>
Registros agregados: <%=i%>
<% }
}catch(BatchUpdateException sqle){
%>
Error causado por SQLException: <%=sqle.getMessage()%>
<%}catch(SQLException bue){%>
Error causado por SQLException: <%=bue.getMessage()%>
<%}%>

Similar Messages

  • VAPI ISO trigger causes error on insert with autogen cols

    The ISO trigger that is generated will go like:
    when insert/update: copy :new.col's to cg$rec.col's
    next when inserting all cg$ind.col's will be set to TRUE, after which the TAPI CG$table.ins is called, passing cg$rec and cg$ind.
    In the ins procedure, autogen columns will be set in a procedure called
    up_autogen_columns
    BUT ONLY WHEN THE CG$IND for the column is FALSE.
    In other words only when the indicators tells that there is no value, the code will be executed.
    The code generated by the headstart utility seems to be wrong. I think it should set the cg$ind value for autogen columns to false!
    The workaround is to manually edit the generated VAPI trigger and set the indicators but this causes a lot of extra work that is accident prone!
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Peter Terpoorten ([email protected]):
    The ISO trigger that is generated will go like:
    when insert/update: copy :new.col's to cg$rec.col's
    next when inserting all cg$ind.col's will be set to TRUE, after which the TAPI CG$table.ins is called, passing cg$rec and cg$ind.
    In the ins procedure, autogen columns will be set in a procedure called
    up_autogen_columns
    BUT ONLY WHEN THE CG$IND for the column is FALSE.
    In other words only when the indicators tells that there is no value, the code will be executed.
    The code generated by the headstart utility seems to be wrong. I think it should set the cg$ind value for autogen columns to false!
    The workaround is to manually edit the generated VAPI trigger and set the indicators but this causes a lot of extra work that is accident prone!<HR></BLOCKQUOTE>
    null

  • Compiled trigger causes database hung

    Hi there,
    I compile some triggers in our database and they cause our database hung, how can I do ? any hint? Thx

    That is ugly - calling a remote proc from inside a trigger. And the wrong thing to do in most cases.
    A trigger is there to protect the integrity of the data and transaction. A remote proc call can fail for numerous reasons. Network issues. Remote db is in restricted mode/down. Etc. These will cause the trigger to fail. The trigger failure will cause the business transaction to fail.
    And I'm pretty sure that no business transaction and validation and processing logic dictates that it must fail because of sonmething like a network problem if it can be prevented.
    If this is a replication issue, you should consider using Oracle's built-in replication instead.
    Anything else - I would rather have the trigger inserting instructions (into a table) for a background (DBMS_JOB) process to pick up and execute.

  • Database trigger causes error in Form

    I have a database trigger on the per_performance_reviews table. When I try to save a performance review record from the forms I get the following error:
    FRM-40403: A calling form has unapplied changes. Save not allowed.
    Any suggestions???
    Here is my trigger:
    CREATE OR REPLACE TRIGGER APPS.XXPER_UPDATE_PERF_REVIEW
    BEFORE INSERT ON HR.PER_PERFORMANCE_REVIEWS
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    l_hire_date DATE;
    l_next_review_Date DATE;
    l_event_type VARCHAR2(40);
    BEGIN
    select papf.START_DATE, pe.type
    into l_hire_date, l_event_type
    from per_all_people_f papf, per_performance_reviews ppr, per_events pe
    where ppr.performance_review_id = :NEW.performance_review_id
    and papf.person_id = ppr.person_id
    and pe.event_id = ppr.event_id
    and sysdate between papf.effective_start_date and papf.effective_end_date;
    l_next_review_date := l_hire_date + (365 * 2);
    IF l_event_type = 'APPRAISAL' THEN
    :NEW.NEXT_PERF_REVIEW_DATE := l_next_review_date;
    END IF;
    END XXPER_UPDATE_PERF_REVIEW;

    There is a forms forum here too.
    However this error message
    FRM-40403: A calling form has unapplied changes. Save not allowed.
    implies that you opend your current form without posting/commiting in the previous form. This is not allowed. Your changes never even touched the database.

  • Db link in trigger causes compilation error

    Using Forms 10.1.2.0.2
    Post-Query trigger
    BEGIN
    SELECT item_desc
    INTO :block1.item_desc
    FROM items@database100
    WHERE item_code = :block1.item_code;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    item_code := 'No description for this item';
    END;
    Compilation error
    Error 201: Identifier 'items@database100' must be declared.
    The select statement works in Toad and Sqlplus, but giving me compilation errors in Forms 10g.
    So is this a bug? If yes, is there a patch?
    Can somebody please post a link to a metalink where this problem is discussed/solved?
    Thanks in advance.

    Well, yeah, that had been considered as a work-around.
    However, at this point, the decision is still to use the db link, and we are still trying to figure out how to make it work.
    Edited by: vanilla.villain on May 21, 2009 11:20 AM

  • Lightbox trigger cause crash "out of bound"

    Im trying to extend my portfolio using ligthbox and triggers and was successful until I created a trigger and tried to move it on top of a thumbnail. Whenever I grab this one trigger (the others still work fine) I get a message that says "Invalid location:17 in collection of length:15 adding part '' within part '' in widget 'Widgets::pamphlet2_panel'" or "out of bounds" I can't delete it from the layers panel. I restarted computer, but muse crashes everytime I try to add another trigger using the plus sign.

    did you ever figure out a solution? I'm having the same problem

  • Database trigger causes "TooManyObjectsException JBO-25013" in view object

    Hi all,
    I have two tables in a parent - child relationship. Each has it's entity and view object with appropriate associations and links. The parent table has an insert trigger which inserts default rows into the child table when a new parent row is created.
    So the sequence is as follows:
    1) User has view of parent and child tables on one form.
    2) Clicks on parent table row, associated child rows are displayed in child table.
    3) User clicks on Insert button on parent table nav bar.
    4) User enters data and clicks the Commit button on parent table nav bar.
    5) BC4J framework goes off into the JUNavigationBar.actionPerformed() method.
    6) Next thing I see is the error below:
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[2210 ].
    I have confirmed that if I disable the trigger the problem goes away. I also tried clearing the cache on the child table just before the JUNavigationBar.actionPerformed() but it does not help.
    I suspect that the VO gets confused by the rows inserted by the trigger when it reloads the data during the last phases of the commit.
    How do I get around this problem??
    Any suggestions welcome. I'm desperate at this stage!
    Thanks,
    Stefan Mahs
    PS: the stack trace follows:
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the
    primary key oracle.jbo.Key[2210 ].
    at oracle.jbo.server.EntityCache.add(EntityCache.java:371)
    at
    oracle.jbo.server.ViewRowStorage.entityCacheAdd(ViewRowStorage.java:1493)
    at
    oracle.jbo.server.ViewRowImpl.entityCacheAdd(ViewRowImpl.java:1955)
    at
    oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1021)
    at
    oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2219)
    at
    oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:2149)
    at
    oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:1577)
    at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:1429)
    at oracle.jbo.server.QueryCollection.get(QueryCollection.java:966)
    at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:2731)
    at
    oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2457)
    at
    oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2321)
    at
    oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:2522)
    at
    oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:1604)
    at
    oracle.jbo.server.ViewRowSetImpl.refreshRowSet(ViewRowSetImpl.java:3468)
    at
    oracle.jbo.server.ViewRowSetIteratorImpl.notifyDetailRowSets(ViewRowSetIteratorImpl.java:2952)
    at
    oracle.jbo.server.ViewRowSetIteratorImpl.fireRowUpdated(ViewRowSetIteratorImpl.java:3098)
    at
    oracle.jbo.server.ViewRowSetIteratorImpl.notifyRowUpdated(ViewRowSetIteratorImpl.java:2767)
    at
    oracle.jbo.server.ViewRowSetImpl.notifyRowUpdated(ViewRowSetImpl.java:1113)
    at
    oracle.jbo.server.ViewObjectImpl.notifyRowUpdated(ViewObjectImpl.java:6109)
    at
    oracle.jbo.server.ViewObjectImpl.notifyRowUpdated(ViewObjectImpl.java:6087)
    at
    oracle.jbo.server.ViewObjectImpl.afterRowUpdate(ViewObjectImpl.java:7057)
    at
    oracle.jbo.server.ViewObjectImpl.sourceChanged(ViewObjectImpl.java:7222)
    at
    oracle.jbo.server.EntityCache.deliverEntityEvent(EntityCache.java:504)
    at
    oracle.jbo.server.EntityCache.notifyColumnChange(EntityCache.java:534)
    at
    oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:4034)
    at
    oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:442)
    at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:4592)
    at mdh.bc4j.SkusImpl.doDML(SkusImpl.java:1257)
    at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:3658)
    at
    oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2336)
    at
    oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2246)
    at
    oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1541)
    at
    oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:1707)
    at
    oracle.jbo.uicli.binding.JUApplication.commitTransaction(JUApplication.java:820)
    at
    oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:350)
    at
    oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:257)
    at
    oracle.jbo.uicli.controls.JUNavigationBar.actionPerformed(JUNavigationBar.java:228)
    at
    mdh.client.sku.JUNavigationBarStateful.actionPerformed(JUNavigationBarStateful.java:72)
    at
    javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at
    javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at
    javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at
    javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at
    javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at
    java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:227)
    at java.awt.Component.processMouseEvent(Component.java:5134)
    at java.awt.Component.processEvent(Component.java:4931)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3639)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at
    java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at
    java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1590)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

    Let me know when you have a testcase you can email.- unfortunatelly, we cannot reproduce this behavior by using the FOD/Fussion schema with the BrowseEdit demo application (from the Cue cards), everything works as expected.
    After making an analogue trigger on our working schema, this error behaviour still repeats. But, here is our stack trace, maybe this can help. Note addForAltKey(...) bellow, we have one Alternate key. On the other hand, here is part from "Developer quide":
    Whenever any of the key attribute values change, this rule validates that the new key
    does not belong to any other entity object instance of this entity object class. (It is the
    business-logic tier equivalent of a unique constraint in the database.) If the key is
    found in one of the entity objects, a TooManyObjectsException is thrown. The
    validation check is done both in the entity cache and the database
    - we do not know if it is a problem, but looks like that. Note that problem occurs even if we are inserting the first master record.
    In nay case, here is our stack trace:
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[49 ].
         at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:369)
         at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:726)
         at oracle.jbo.server.EntityCache.add(EntityCache.java:347)
         at oracle.jbo.server.ViewRowStorage.entityCacheAdd(ViewRowStorage.java:2266)
         at oracle.jbo.server.ViewRowImpl.entityCacheAdd(ViewRowImpl.java:2631)
         at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:3995)
         at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:2677)
         at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:2558)
         at oracle.jbo.server.QueryCollection.get(QueryCollection.java:1788)
         at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:4142)
         at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2824)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2680)
         at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:2921)
         at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:2339)
         at oracle.jbo.server.ViewRowSetImpl.refreshRowSet(ViewRowSetImpl.java:5525)
         at oracle.jbo.server.ViewRowSetIteratorImpl.notifyDetailRowSets(ViewRowSetIteratorImpl.java:3416)
         at oracle.jbo.server.ViewRowSetIteratorImpl.fireRowUpdated(ViewRowSetIteratorImpl.java:3602)
         at oracle.jbo.server.ViewRowSetIteratorImpl.notifyRowUpdated(ViewRowSetIteratorImpl.java:3222)
         at oracle.jbo.server.ViewRowSetImpl.notifyRowUpdated(ViewRowSetImpl.java:1670)
         at oracle.jbo.server.ViewObjectImpl.notifyRowUpdated(ViewObjectImpl.java:9138)
         at oracle.jbo.server.ViewObjectImpl.notifyRowUpdated(ViewObjectImpl.java:9115)
         at oracle.jbo.server.ViewObjectImpl.afterRowUpdate(ViewObjectImpl.java:10267)
         at oracle.jbo.server.ViewObjectImpl.sourceChanged(ViewObjectImpl.java:10484)
         at oracle.jbo.server.EntityCache.sendEvent(EntityCache.java:1044)
         at oracle.jbo.server.EntityCache.deliverEntityEvent(EntityCache.java:1058)
         at oracle.jbo.server.EntityCache.notifyColumnChange(EntityCache.java:1113)
         at oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:6035)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:525)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:6971)
         at com.energosoft.tee.model.entities.TeeTradingTicketEOImpl.doDML(TeeTradingTicketEOImpl.java:87)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:5428)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3129)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2937)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2061)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2263)
    ----------

  • Error inserting data after creating a trigger (caused by commit)

    Hi,
    I have registered a schema so that XML files are stored in a table XMLREADINGS. I create an AFTER INSERT tigger on this table. The trigger is very basic (inserting the system date into a test table). I discovered that it works fine so long as there is no COMMIT statement in the trigger (an implicit commit is carried out). However if I have a COMMIT then creation of the trigger is fine, but when I try to drop new XML files into the repository (using WebDav) I get a file copy error.
    For this simple case the lack of an explicit COMMIT statement is okay, but I want to increase the logic of the trigger and I can imagine that there will be COMMIT and ROLLBACK statements required.
    Has anyone experienced this before ?
    regards
    Stephen

    I've just discovered that you aren't supposed to use commit or rollback in triggers anyway!
    A possible solution (found on this forum) is to declare the trigger as a autonomous transaction:
    If you are using Oracle 8i, you can use an autonomous transaction:
    CREATE OR REPLACE TRIGGER trg
    DECLARE
    Pragma Autonomous_Transaction
    BEGIN
    I'll give that a try

  • Text Area Trigger Causing Document items to shift

    Hi All,
    I recently slapped a trigger on a text area in my document. When it is not triggered, it appears that all elements on the page move up to replace the blank space. Is there a way to turn this off for certain elements?
    Thank you,
    Ken

    I'm going to guess that you have multiple overlapping text areas where you only expect one to trigger and the other to not. One easy solution is probably to use a Paragraph Selection on a multi-line text field instead of individual text areas that overlap. Instead of a text area, create a MLT field. Create a Paragraph Selection List (PSL) and add your prior text area content as paragraphs. Assign the triggers to paragraphs that you previously assigned to the individual text areas. Have the field use the PSL you created and assign the field with the ParagraphAssembly rule. That will evaluate your triggers during generation and the content you want will fill in and the text will “grow” instead of shrinking. There is an attribute that can be assigned to Paragraph Selection fields if you don't want the user to be able to edit the content - that is if you are kicking the transaction to WIP for local editing.

  • Trigger issues

    Hi guys,
    I'm having an issue with a trigger but I don't think it's the trigger causing the problem:
    I have a table called mytable (actual name withheld to protect the innocent)
    Which has a trigger which inserts into an audit table every time there is an insert/update/deletion from mytable.
    See code below:
    Create table auditdebug
    (timestamp date,
    Old clob,
    New clob,
    Type varchar2(100));
    Create table mytable
    (id number,
    clobcolumn clob);
    CREATE OR REPLACE TRIGGER mytriggername
    after insert or update or delete on mytable
    for each row
    begin
      case
        when inserting then
          insert into auditdebug (timestamp, old, new, type) values (sysdate,:old.clobcolumn,:new.clobcolumn,'insert');
        when updating then
          insert into auditdebug (timestamp, old, new, type) values (sysdate,:old.clobcolumn,:new.lobcolumn,'update');
        when deleting then
          insert into auditdebug (timestamp, old, new, type) values (sysdate,:old.clobcolumn,:new.clobcolumn,'delete');
      end case;
    end;This is working absolutely fine when I update the mytable table via a directly inputted update statement in sql*plus etc.
    However
    The same table is updated/inserted into via an oracle form and the :new.query_text is inserted into my audit table as an empty clob while the true new value still goes through into the MYTABLE table as expected.
    I'm stumped as to how this could happen. The :new.clobcolumn doesn't get into my audit table, but the MYTABLE table is updated/inserted into correctly!!!!
    Thoughts? Where do I look next?

    ok, so an update:
    forgot my oracle version for a start:
    it's 10g Enterprise Edition Release 10.2.0.3.0 - 64bit
    oracle forms version is 6i which was intended for the database version 8i I think.
    the form that looks at the table has the clob value column as a LONG datatype and not a CLOB. forms 6i doesn't appear to have CLOB as an option (although I've got very little experience with forms).
    the trigger works fine when I update the table in a script or manually as you have done, it's just something goes funny when the table is updated via the oracle form.
    --doing some more tests and will come back if I get anything..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Externally trigger binned counting

    Hi,
    I have a PCI-6221 and am trying to achieve the following.  I've tried searching and found similar questions, but nothing exactly the same, so apologies if I have overlooked a previous answer.
    What I would like to do is count total pulses per 100 µs for some fixed period of time, say 100 ms.  The start of the 100 ms total measurement period should be triggered by an external signal which is much slower, e.g. 1Hz  This is as I need to sum multiple mesurement events as follows, where the time bins given are times after the trigger signal and each measurement is triggered by the external signal.
    Measurement     0-100µs  100-200µs    200-300µs   etc.
           1                    2                1                0
           2                    1                2                1
           3                    2                1                1
           4                    0                1                0
        total                  5                5                2
    If I could get the rolling total for each measurement that would also be fine, I can subtract each time bin from the previous in software.  The previous example using this method would therefore be:
    Measurement     0-100µs  100-200µs    200-300µs   etc.
           1                    2                3                3
           2                    1                3                4
           3                    2                3                4
           4                    0                1                1
        total                  5                10              12
    I have looked at previous answers such as http://forums.ni.com/ni/board/message?board.id=40&​message.id=2056&query.id=1096458#M2056 and whilst I converted that to a finite number of measurements OK, I couldn't work out how to set it to digitally trigger without errors.  I'm using LabView 7.1.
    Thanks very much, I hope that this was clear.
    Alex

    I haven't fully fleshed out this idea, but here it is in a think-out-loud form.
    I'm assuming you don't have clocked analog output in your app, and will lean on using an AO task solely for its clock.
    Here's the idea:
    1. One of your counters is set as a retriggerable single pulse generator.  Let's say it's CTR0.  Use the external ~1Hz signal as its trigger, and set it up to generate a single pulse with a 100 msec high time and a minimal low time.  You'll need a DAQmx property node to make it retriggerable.
    2. Configure an AO task to generate at 10 kHz, corresponding to your 100 microsec bins.  Configure it to be pause triggered by the output of CTR0.  Thus, the AO generates samples at 10 kHz, but only while CTR0 output is high (for 100 msec).  You'll have to write a buffer of analog values to generate, but it can just be an array full of 0 voltage, and you don't have to wire that output to anything either.
    3. Configure your other counter, CTR1, for period measurement.  This may be tricky to configure with DAQmx property nodes, but ultimately you'll need to treat your pulses of interest as the timebase for the measurement while using the AO sample clock as the signal to be measured.   That sounds backwards, but the effect will be to store the number of your pulses of interest that occur between AO clock edges.  You will need to research "duplicate count prevention" to make sure that 0 values get buffered properly.
    I *think* that sort of arrangement could work.  About every second, you get an external trigger.  That trigger causes CTR0 to generate a single pulse with a 100 msec high time.  Your AO task generates a clock pulse every 100 microsec, but only during the 100 msec when CTR0 is high.  Each of those AO clock pulses buffers a value for your CTR1 period measurement.  This should produce a measurement buffer like the first one you listed.
    4. (Simpler Alternative) Configure CTR1 for simple counting.  Use DAQmx Timing.vi to specify the use of the AO Sample clock, and specify your external pulses of interest as the signal to measure.  By default, LabVIEW will expect to see those pulses at CTR1's default SOURCE pin.  This arrangement should produce a measurement buffer like the second one you listed, though you may still need to research "duplicate count prevention" to make sure that gets set up right.
    5. I can't help but think there's another way to do this without the AO stuff, but nothing's coming to me now.
    -Kevin P
    Message Edited by Kevin Price on 02-01-2010 02:19 PM

  • Problem using secondary database, sequence (and custom tuple binding)

    I get an exception when I try to open a Sequence to a database that has a custom tuple binding and a secondary database. I have a guess what the issue is (below), but it boils down to my custom tuple-binding being invoked when opening the sequence. Here is the exception:
    java.lang.IndexOutOfBoundsException
    at com.sleepycat.bind.tuple.TupleInput.readUnsignedInt(TupleInput.java:4
    14)
    at com.sleepycat.bind.tuple.TupleInput.readInt(TupleInput.java:233)
    at COM.shopsidekick.db.community.Shop_URLTupleBinding.entryToObject(Shop
    _URLTupleBinding.java:72)
    at com.sleepycat.bind.tuple.TupleBinding.entryToObject(TupleBinding.java
    :73)
    at COM.tagster.db.community.SecondaryURLKeyCreator.createSecondaryKey(Se
    condaryURLKeyCreator.java:38)
    at com.sleepycat.je.SecondaryDatabase.updateSecondary(SecondaryDatabase.
    java:546)
    at com.sleepycat.je.SecondaryTrigger.databaseUpdated(SecondaryTrigger.ja
    va:42)
    at com.sleepycat.je.Database.notifyTriggers(Database.java:1343)
    at com.sleepycat.je.Cursor.putInternal(Cursor.java:770)
    at com.sleepycat.je.Cursor.putNoOverwrite(Cursor.java:352)
    at com.sleepycat.je.Sequence.<init>(Sequence.java:139)
    at com.sleepycat.je.Database.openSequence(Database.java:332)
    Here is my code:
    // URL ID DB
    DatabaseConfig urlDBConfig = new DatabaseConfig();
    urlDBConfig.setAllowCreate(true);
    urlDBConfig.setReadOnly(false);
    urlDBConfig.setTransactional(true);
    urlDBConfig.setSortedDuplicates(false); // No sorted duplicates (can't have them with a secondary DB)
    mURLDatabase = mDBEnv.openDatabase(txn, "URLDatabase", urlDBConfig);
    // Reverse URL lookup DB table
    SecondaryConfig secondaryURLDBConfig = new SecondaryConfig();
    secondaryURLDBConfig.setAllowCreate(true);
    secondaryURLDBConfig.setReadOnly(false);
    secondaryURLDBConfig.setTransactional(true);
    TupleBinding urlTupleBinding = DataHelper.instance().createURLTupleBinding();
    SecondaryURLKeyCreator secondaryURLKeyCreator = new SecondaryURLKeyCreator(urlTupleBinding);
    secondaryURLDBConfig.setKeyCreator(secondaryURLKeyCreator);
    mReverseLookpupURLDatabase = mDBEnv.openSecondaryDatabase(txn, "SecondaryURLDatabase", mURLDatabase, secondaryURLDBConfig);
    // Open the URL ID sequence
    SequenceConfig urlIDSequenceConfig = new SequenceConfig();
    urlIDSequenceConfig.setAllowCreate(true);
    urlIDSequenceConfig.setInitialValue(1);
    mURLSequence = mURLDatabase.openSequence(txn, new DatabaseEntry(URLID_SEQUENCE_NAME.getBytes("UTF-8")), urlIDSequenceConfig);
    My secondary key creator class looks like this:
    public class SecondaryURLKeyCreator implements SecondaryKeyCreator {
    // Member variables
    private TupleBinding mTupleBinding; // The tuple binding
    * Constructor.
    public SecondaryURLKeyCreator(TupleBinding iTupleBinding) {
    mTupleBinding = iTupleBinding;
    * Create the secondary key.
    public boolean createSecondaryKey(SecondaryDatabase iSecDB, DatabaseEntry iKeyEntry, DatabaseEntry iDataEntry, DatabaseEntry oResultEntry) {
    try {
    URLData urlData = (URLData)mTupleBinding.entryToObject(iDataEntry);
    String URL = urlData.getURL();
    oResultEntry.setData(URL.getBytes("UTF-8"));
    catch (IOException willNeverOccur) {
    // Success
    return(true);
    I think I understand what is going on, and I only noticed it now because I added more fields to my custom data (and tuple binding):
    com.sleepycat.je.Sequence.java line 139 (version 3.2.44) does this:
    status = cursor.putNoOverwrite(key, makeData());
    makeData creates a byte array of size MAX_DATA_SIZE (50 bytes) -- which has nothing to do with my custom data.
    The trigger causes an call to SecondaryDatable.updateSecondary(...) to the secondary DB.
    updateSecondary calls createSecondaryKey in my SecondaryKeyCreator, which calls entityToObject() in my tuple-binding, which calls TupleInput.readString(), etc to match my custom data. Since what is being read goes for more than the byte array of size 50, I get the exception.
    I didn't notice before because my custom tuple binding used to read fewer that 50 bytes.
    I think the problem is that my tuple binding is being invoked at all at this point -- opening a sequence -- since there is no data on which it can act.

    Hi,
    It looks like you're making a common mistake with sequences which is to store the sequence itself in a database that is also used for application data. The sequence should normally be stored in separate database to prevent configuration conflicts and actual data conflicts between the sequence record and the application records.
    I suggest that you create another database whose only purpose is to hold the sequence record. This database will contain only a single record -- the sequence. If you have more than one sequence, storing all sequences in the same database makes sense and is safe.
    The database used for storing sequences should not normally have any associated secondary databases and should not be configured for duplicates.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Customer number not in the inspection lot for a make to order scenario

    Hi All,
    I know that standard SAP will get the Customer number into Insp. lot only for insp. types 10/11/12.  I am wondering if someone know a way to get the customer no. into insp. lot for insp. type 04 where the material is make-to-order scenario and the Production/Process order has the Sales order and customer no. without activating User-exit.  The quality users want to be able to see the customer no. in insp. lot without having them to go to process order. 
    It makes no sense to me why the customer no. is not brought into insp. lot when that is available in the Prod/process order, which can further be used to select the customer specific insp. plans for 04 insp. type Insp. lot without using Variant configuration.
    Any light on this topic is appreciated.
    Thanks.

    Hi Srikant,
    I guess.........
    Normally the inspection lot refers the triggering document that are the trigger cause for them.
    - Inspection type 01: - Purchase Order and GR material document.
    - Inspection type 03: - Pro. Order Number
    The same way...
    The inspection type 10\11\12 are purely related to the SD, and directly integrates QM and SD. Hence in the inspection lot for the inspection types directly integrated to SD, it will furnish the Sales order number \ Customer.
    But the inspection type 04 is purely have it's relation to Production process. So it will have the details related to integrations it has i.e. the "Pro. Order." Hence it integrates QM-PP, it have the data related to PP (Pro Order), not the SD's one.
    But I think one way you can achieve it,
    Assign the Customer number also to the inspection plan along with the Material. So I think at the time of assigning the inspection plan to the inspection lot, it will refer the Customer number also and will display the Customer number along with Task list Group\Group Counter, in the inspection specification screen in QA03/02
    Regards,
    Shyamal

  • JBO-25013: Too many objects match the primary key oracle.jbo.Key[33 ]!!!

    Hi all, I have a huge problem...
    I have two tables in a parent - child relationship. Each has it's own entity and view object with appropriate associations and links. The parent table has an insert trigger which inserts default rows into the child table when a new parent row is created.
    Even in the application module tester (not to mention the equivalent .jspx)
    this error goes off :
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[35 ].
    Sometimes, I couldn't figure out what makes the difference, the tester inserts the detail records just fine when inserting the master, but never from the page!!!
    How do I get around this problem?? I'm clueless.
    Any suggestions welcome. I'm desperate at this stage!
    A lots'a work will be lost (packages and triggers on the server...:((( if there's no solution.
    Thanx for yr help in advance, Ildiko

    looks like Database trigger causes "TooManyObjectsException JBO-25013" in view object

  • Row cannot be located for updating. Some values may have been changed...

    Hello,
    I have a legacy application written in VB6 and using Oracle OLEDB Provider (version 9 and updated to the last ones from oracle site)
    I've a problem during insert of a record using recordset method (AddNew).
    The returned message is "Row cannot be located for updating. Some values may have been changed since it was last read. "
    I know that problem is caused by a Before Insert trigger that I CANNOT change.
    Trigger does not change any primary key values !!!. It put only some default values on other not rilevant columns.
    I tried to use the recordset Property option "Update Criteria" = adCriteriaKey without success !
    I had same problem with SQL Server but i solved putting into the trigger SET NOCOUNT ON.
    I think problem is related to the fact that ADO tries to calculate number of affected rows and for doing that it use a where clause built on the changed columns but using values it had on the client.
    Other important info:
    Cursor = adUseClient (and i cannot adUseServer)
    Provider= MSDAORA (version 9.2...)
    Oracle server = 9.1
    Trigger causing problem = BEFORE INSERT (for each row)
    Thanks in advance
    Luigi

    Hello,
    I have a legacy application written in VB6 and using Oracle OLEDB Provider (version 9 and updated to the last ones from oracle site)
    I've a problem during insert of a record using recordset method (AddNew).
    The returned message is "Row cannot be located for updating. Some values may have been changed since it was last read. "
    I know that problem is caused by a Before Insert trigger that I CANNOT change.
    Trigger does not change any primary key values !!!. It put only some default values on other not rilevant columns.
    I tried to use the recordset Property option "Update Criteria" = adCriteriaKey without success !
    I had same problem with SQL Server but i solved putting into the trigger SET NOCOUNT ON.
    I think problem is related to the fact that ADO tries to calculate number of affected rows and for doing that it use a where clause built on the changed columns but using values it had on the client.
    Other important info:
    Cursor = adUseClient (and i cannot adUseServer)
    Provider= MSDAORA (version 9.2...)
    Oracle server = 9.1
    Trigger causing problem = BEFORE INSERT (for each row)
    Thanks in advance
    Luigi

Maybe you are looking for