Optimistic Concurrency exception ALWAYS thrown when field set to "Fixed"

Hello,
I'm concerned that there is a bug in the ODP.net interaction with the Entity Framework for Optimistic Concurrency Checking.
I have a sequence field called tracker_id on a table that has a before insert trigger on it, which is updated to the next logical sequence number every time the record is updated. The tracker_id attribute in the object entity has had its "Concurrency Mode" set to "Fixed".
The problem is that irrespective of whether a record has been updated in another session or not, the optimistic concurrency exception is always thrown. Please see message below:-
"Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries."
code below
catch (OptimisticConcurrencyException ocex)
                string message;
                if (ocex.InnerException != null)
                    message = ocex.Message + "-" + ocex.InnerException.Message;
                else
                    message = ocex.Message;
                mm.ERRORCODE = "1";
                mm.ERRORMESSAGE = "Record has been updated by another user - Full Message: " + message;
                var poobject = ocex.StateEntries[0].Entity;
                tasdb.Refresh(System.Data.Objects.RefreshMode.StoreWins, poobject);
                tasdb.SaveChanges();
            }I have tried disabling the trigger on the table, but it still does the above.
Many thanks in advance,
Graeme
Edited by: user4487499 on 09-May-2011 02:34

The data for the newly created row doesn't get inserted into the database until the commit is executed, so the insert trigger isn't called.
If you need to get the value without committing, then you should implement the trigger programmatically and drop the trigger from the database. The code below shows how you could do this.
ViewObject insertVO = findViewObject("myView");
Row newRow = insertVO.createRow();
SequenceImpl seq = new SequenceImpl("MY_SEQ", insertVO.getDBTransaction());
Long next = (Long)seq.getData();
newRow.setAttribute("primaryAttribute", new Number(next));
...You will need to replace MY_SEQ and primaryAttribute with the correct values for your example, but this should acheive what you want.

Similar Messages

  • Row concurrency exception not thrown for 1 page but others

    All pages have the default of true for enableTokeValidation.
    Edit a page -> Save -> Browser Back Button -> Click on Save button
    For all but one of our pages, we will successfuly get the JboException for row concurrency is inconsistent, which is what we need/hope for.
    The one page that does not give this exception is dedicated to "create" a person. After creation, it will navigate to a list name page. If back button is used and the user then click on the "Save" button on this new person page, ADF layer acutally tries to update the person for one field for the last created person. We are expecting the row concurrency exception.
    I have check and read all the thread on back buttons. And the consistent of the entity/view object used by this one page versus the rest.
    Note: All of our pages are using "redirect" navigation.
    Thanks,
    Mel

    One important different I should mention is that
    - the new person page is using a different application module A than the rest
    - all the other maintaining page is using application module B
    Is this why? How to make it work?
    Mel

  • Exception is thrown when creating bean

              Hi, I have some questions about transaction.
              In my case, i call a stateful session bean through the stateless session bean.
              When the bean is created, following exception is thrown
              "javax.transaction.TransactionRolledbackException: Current server is the coordinator
              and transaction is not found. It was probably rolled back and forgotten already."
              The transaction attribute of the stateless session bean is "Required" and the
              one of stateful session bean is "NotSupported".
              I dont know what is happening, would anyone help me please.
              Thanks
              

    Try asking this in the interest.ejb group.
              Thanks.
              "Leo" <[email protected]> wrote in message news:3f7b7c21$[email protected]..
              >
              > Hi, I have some questions about transaction.
              > In my case, i call a stateful session bean through the stateless session bean.
              > When the bean is created, following exception is thrown
              >
              > "javax.transaction.TransactionRolledbackException: Current server is the coordinator
              > and transaction is not found. It was probably rolled back and forgotten already."
              >
              > The transaction attribute of the stateless session bean is "Required" and the
              > one of stateful session bean is "NotSupported".
              >
              > I dont know what is happening, would anyone help me please.
              >
              > Thanks
              >
              >
              

  • No exception is thrown when my server socket dies

    I have a server application running on sunOS 5.7.
    To this I have both Windows and SunOS clients connected via TCP/IP. (Server built with jdk 1.2.2 and client with 1.3.0)
    If the Server socket dies an exception is thrown in the windows clients but not in the sunOS client.
    I need the exception to be thrown in the sunOS as well.
    Is there anybody who knows how to get this done?
    Thanks in advance.
    /Henrik

    You could poll the connection to see if its there.
    If you want the client to register the event then have your client create a sort of listener of your own when it connects. By 'sort of listener' I mean extend the thread class and have it check the connection is not null every n seconds. If it is null then raise the exception yourself.
    Would this do it?
    Rob.

  • Exception is thrown when Memebr roles is used in XML JAZN

    Hi,
    I am trying to use the Member roles feature in the JAZN xml file. However, Once you run the application below exception is thrown.
    08/08/31 00:33:18 oracle.security.jazn.JAZNObjectNotFoundException
    08/08/31 00:33:18      at oracle.security.jazn.spi.xml.XMLRealmRole.init(XMLRealmRole.java:310)
    08/08/31 00:33:18      at oracle.security.jazn.spi.xml.XMLRoleManager.init(XMLRoleManager.java:186)
    08/08/31 00:33:18      at oracle.security.jazn.spi.xml.XMLRealm.init(XMLRealm.java:200)
    08/08/31 00:33:18      at oracle.security.jazn.spi.xml.XMLRealmManager.init(XMLRealmManager.java:167)
    08/08/31 00:33:18      at oracle.security.jazn.spi.xml.XMLJAZNProvider.parseDataFile(XMLJAZNProvider.java:403)
    08/08/31 00:33:18      at oracle.security.jazn.spi.xml.XMLJAZNProvider.getRealmManager(XMLJAZNProvider.java:480)
    08/08/31 00:33:18      at oracle.security.jazn.spi.GenericProvider.getRealmManager(GenericProvider.java:143)
    08/08/31 00:33:18      at oracle.security.jazn.JAZNConfig.getRealmManager(JAZNConfig.java:1014)
    08/08/31 00:33:18      at oracle.security.jazn.oc4j.JAZNUserManager.getUMType(JAZNUserManager.java:5156)
    08/08/31 00:33:18      at oracle.security.jazn.oc4j.JAZNUserManager.getUM(JAZNUserManager.java:5208)
    08/08/31 00:33:18      at oracle.security.jazn.oc4j.JAZNUserManager.<init>(JAZNUserManager.java:5245)
    08/08/31 00:33:18      at com.evermind.server.deployment.UserManagerConfig$JAZN.construct(UserManagerConfig.java:629)
    08/08/31 00:33:18      at com.evermind.server.deployment.UserManagerConfig.delegatee(UserManagerConfig.java:289)
    08/08/31 00:33:18      at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    08/08/31 00:33:18      at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    08/08/31 00:33:18      at com.evermind.server.XMLApplicationServerConfig.setPassword(XMLApplicationServerConfig.java:3011)
    08/08/31 00:33:18      at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:95)
    08/08/31 00:33:18      at java.lang.Thread.run(Thread.java:595)
    Can anybody help me solving this problem?!

    Younis2,
    That was the important piece of information you needed to provide ;) I get the same exception if I try to do nested roles, but it doesn't prevent my application from starting - looks like it may be a bug - suggest you post a new thread with the word BUG in the title and give a really simple test case. I was able to reproduce quite simply by using tools->embedded oc4j preferences, and then editing the jazn configuration there to nest one role inside of another.
    John

  • Will Exception be thrown when Socket is disconnected?

    Hi
    I would like to know will Exception be guaranteedly thrown if the other side(client or server) disconnect.
    If not, how do I test the other side socket has been gone?
    Thanks a lot
    Matt

    When the remote end of a TCP/IP connection calls close() on its socket, the remote operating system sends a FIN packet to your operating system. After this, if you try to read or write to the socket, you get an end-of-file indication. The indication depends on the API you use; it can be an IOException, -1, null, etc; read the API doc for the method you use for reading and writing.
    A somewhat related question is: what if the peer computer crashes, or its Ethernet connector is unplugged. Then it can't send you a FIN or anything else. When you write to the peer, your operating system will send the data, and wait for a reply (ACK packet) for a while. The ACK doesn't arrive, so your OS will re-send, wait, re-send, and finally give up, after a minute or so. After that you'll get IOExceptions when you read or write to the socket.
    If the remote end crashes or is unplugged, and you read() from a socket, nothing happens. Your read() will patiently wait forever for data that will never arrive. For this reason, it is sometimes advisable to have a "heartbeat" in your protocol: send some dummy "are you there" message occasionally. That will trigger the send/wait-for-ACK/re-send/wait-for-ACK process, and after a minute your read()s and write()s will IOExcept to tell you the other end is gone.

  • Exception is thrown when using JEditorPane to display html

    Hello,
    I have this basic browser to display some pages from our intranet. Here's the code for it:
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JEditorPane;
    import javax.swing.JScrollPane;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.io.IOException;
    public class BrowserPanel extends JPanel {
    private JEditorPane pane = null;
    // Constructors
    public BrowserPanel() {
    pane = new JEditorPane();
    pane.setEditable(false);
    JScrollPane sp = new JScrollPane(pane);
    sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    setLayout(new BorderLayout());
    add(sp, BorderLayout.CENTER);
    // Methods
    public void setContent(String str) {
    StringBuffer sb = new StringBuffer(500);
    sb.append("http://local.com/cgi-bin/search.pl?arg=");
    sb.append(str);
    try {
    URL url = new URL(sb.toString());
    pane.setPage(url);
    } catch (MalformedURLException e) {
    System.err.println("Malformed URL: " + e);
    } catch (IOException e) {
    System.err.println("IOException: " + e);
    On some of the pages I get text all scrambled and the following exception comes up:
    java.lang.ArrayIndexOutOfBoundsException
    at javax.swing.text.html.TableView$RowView.layoutMajorAxis(TableView.java:1393)
    at javax.swing.text.BoxView.layout(BoxView.java:580)
    at javax.swing.text.BoxView.setSize(BoxView.java:265)
    at javax.swing.text.BoxView.paint(BoxView.java:283)
    at javax.swing.text.html.TableView$RowView.paint(TableView.java:1315)
    at javax.swing.text.html.TableView.paint(TableView.java:740)
    at javax.swing.text.BoxView.paintChild(BoxView.java:104)
    at javax.swing.text.BoxView.paint(BoxView.java:294)
    at javax.swing.text.html.BlockView.paint(BlockView.java:240)
    at javax.swing.text.BoxView.paintChild(BoxView.java:104)
    at javax.swing.text.BoxView.paint(BoxView.java:294)
    at javax.swing.text.html.BlockView.paint(BlockView.java:240)
    at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1170)
    at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:523)
    at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:657)
    at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:636)
    at javax.swing.JComponent.paintComponent(JComponent.java:395)
    at javax.swing.JComponent.paint(JComponent.java:687)
    at javax.swing.JComponent.paintChildren(JComponent.java:498)
    at javax.swing.JComponent.paint(JComponent.java:696)
    at javax.swing.JViewport.paint(JViewport.java:668)
    at javax.swing.JComponent.paintWithBuffer(JComponent.java:3878)
    at javax.swing.JComponent._paintImmediately(JComponent.java:3821)
    at javax.swing.JComponent.paintImmediately(JComponent.java:3672)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    Many thanks for any clues on how to make it work.
    cheers,
    --JavanT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    you should specify that this is an HTML veiwer explicitly, by writting something similar to this,
    editor.setContentType("text/html");
    kit = (HTMLEditorKit) editor.getEditorKit();
    editor.setEditorKit(kit);
    doc = (HTMLDocument) kit.createDefaultDocument();
    editor.setDocument(doc);

  • Em.merge does not throw Optimistic Lock Exception

    Hello,
    we are using Optimistic Lock Exception in a stateful bean managed transaction.
    I am wondering that there is no Optimistic Lock Exception is thrown after em.merge
    The Optimistic Lock Exception is primary thrown on em.flush - is this right?
    A similar problem is described on
    http://www.nabble.com/Optimistic-Lock-Exception-expected-td22742662.html#a22742662
    See serveroutput: The EclipseLink-5006-Exception is thrown after an em.flush
    14:03:11,657 INFO [STDOUT] updateItem
    14:03:11,657 INFO [STDOUT] [EL Finest]: 2009-04-09 14:03:11.657--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--Merge clone with references com.tup.model.Person@131a24c
    14:03:11,657 INFO [STDOUT] merged
    14:03:11,657 INFO [STDOUT] [EL Finest]: 2009-04-09 14:03:11.657--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--Execute query UpdateObjectQuery(com.tup.model.Person@196649c)
    14:03:11,657 INFO [STDOUT] [EL Fine]: 2009-04-09 14:03:11.657--ClientSession(21268424)--Connection(25845065)--Thread(WorkerThread#0[192.168.1.217:4518])--UPDATE mku_person_ver SET first_name = ? WHERE ((ID = ?) AND (((last_name = ?) AND (first_name = ?)) AND (version = ?)))
    bind => [Bernd 982, 5, Kuls, Bernd 98, 2009-04-09 13:12:15.0]
    14:03:11,672 INFO [STDOUT] [EL Warning]: 2009-04-09 14:03:11.672--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--Exception [EclipseLink-5006] (Eclipse Persistence Services - 1.1.0.r3634): org.eclipse.persistence.exceptions.OptimisticLockException
    Exception Description: The object [com.tup.model.Person@196649c] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.tup.model.Person Primary Key> [5]
    14:03:11,688 INFO [STDOUT] [EL Warning]: 2009-04-09 14:03:11.688--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--javax.persistence.OptimisticLockException: Exception [EclipseLink-5006] (Eclipse Persistence Services - 1.1.0.r3634): org.eclipse.persistence.exceptions.OptimisticLockException
    Exception Description: The object [com.tup.model.Person@196649c] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.tup.model.Person Primary Key> [5]
    14:03:11,688 INFO [STDOUT] OptimisticLockException throws MyApplicationException
    14:03:11,688 INFO [STDOUT] MyApplicationException
    14:03:11,735 INFO [STDOUT] [EL Finer]: 2009-04-09 14:03:11.735--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--TX afterCompletion callback, status=ROLLEDBACK
    14:03:11,750 INFO [STDOUT] [EL Finer]: 2009-04-09 14:03:11.75--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--release unit of work
    14:03:11,750 INFO [STDOUT] [EL Finer]: 2009-04-09 14:03:11.75--ClientSession(21268424)--Thread(WorkerThread#0[192.168.1.217:4518])--client released
    14:03:11,750 ERROR [BMTInterceptor] BMT stateful bean 'ModelFacade' did not complete user transaction properly status=STATUS_MARKED_ROLLBACK
    And by this Exception the transaction's status is set to status=STATUS_MARKED_ROLLBACK.
    The transaction can no longer be used.
    I want to use this transaction further and wrap the OptimisticLockException into an MyApplicationException
    (see serveroutput).
    But no change!
    Any Ideas ?
    Regards,
    Martin Kubitza
    T&P Bochum/Germany

    Hi,
    are you using JPA or TopLink ? Check if there is another exception thrown that produces the error. You can try and catch (Exception ex), which will catch them all. if this works the obviously you don't catch the right exception
    I found a post saying that: "If you trying commit directly after persist w/o doing an explicit
    flush then OptimisticLocking Exception maybe nested inside
    RollBackException. What is the top most error on stack? You can catch
    javax.persistence.PersistenceException and try to do this kind of
    error translation
    public static void getThrowable(javax.persistence.PersistenceException
    perex, int code) {
    boolean updateError = false ;
    boolean deleteError = false ;
    KentException kentex = null ;
    Throwable th = null ;
    if( perex instanceof org.apache.openjpa.persistence.RollbackException) {
    th = perex.getCause();
    if(th instanceof OptimisticLockException) {
    updateError = true ;
    if(perex instanceof OptimisticLockException ){
    updateError = true ;
    th = perex ;
    if(perex instanceof org.apache.openjpa.persistence.EntityNotFoundException) {
    deleteError = true ;
    th = perex ;
    http://n2.nabble.com/OptimisticLockException-confusion.-td210621.html
    Frank

  • JUnit - How to assert exception is thrown?

    If I use JUnit how do I assert an exception is thrown when I pass invalid parameters to a method I am testing? For example if I pass a username to a method that I know will cause the method to throw an InvalidUsernameException how do I assert this?

    public void testBadParameter() {
      try {
        objectUnderTest.myMethod(badParameter);
        fail("Foo!");
      } catch (ExcpectedException e) {
        //ok
    }

  • Which exception is thrown?

    Which exception is thrown when a native method breaks?
    For example: when a native method cannot access some device.
    Is it RunTimeException, or just plain Exception, or perhaps something else?
    Thanks.

    The native - C - code is yours. If it encounters an
    error, it is up to you to decide how to deal with it.No. Im using someone elses native methods.
    Chances are, if you are trying to write a wrapper
    around someone elses code...Exactly! :)
    ... you will find the code
    throws C++ exceptions. You have to catch them and
    deal with them.I know that. That is why I posted a question here. Question is: What is that exception?
    One likely way to "deal with them" is to define for
    yourself the exceptions you would like to see in
    java, and have the native methods construct and throw
    those java exceptions. The JNI interface includes
    ways of throwing exceptions while in native code.I don't know that. If you could provide some example it would be most appreciated.
    Thanks.

  • Why is exception not thrown in AseCommand when "Truncation error occurred"?

    In the below SQL, data is written to SOURCE and from there to TARGET.
    The DECIMAL columns in TARGET are deliberately smaller than those in SOURCE (eg a DECIMAL (12, 2) column populated from a DECIMAL (19,11) source).
    When I run this in an Query tool (eg, SqlDbx) I get the messages:
    "Truncation error occurred
    Command has been aborted"
    But when I run this using the .net Client (supplied with the Developer Edition of ASE 16.0) no exception is thrown (the INSERT fails though).  The method is AseCommand.ExecuteNonQuery().
    Is this deliberate? 
    Is this believed to be correct?
    How can I tell that a truncation error has been raised?
    Thanks
    IF OBJECT_ID ('dbo.TARGET') IS NOT NULL
      DROP TABLE dbo.TARGET
    GO
    CREATE TABLE dbo.TARGET
      S_Name_NVARCHAR NVARCHAR (50) null,
        S_RedComponent_DEC_15_6 decimal(15, 6) NULL,
        S_BlueComponent_DEC_12_2 decimal(12, 2) NULL, 
        S_GreenComponent_DEC_18_10 decimal(18, 10) NULL
    GO
    IF OBJECT_ID ('dbo.SOURCE') IS NOT NULL
      DROP TABLE dbo.SOURCE
    GO
    CREATE TABLE dbo.SOURCE
      Name_NVARCHAR      NVARCHAR (2000) NULL,
      RedComponent_DEC   DECIMAL (19,11) NULL,
      GreenComponent_DEC DECIMAL (19,11) NULL,
      BlueComponent_DEC  DECIMAL (19,11) NULL
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('Beige', 272.195, 272.195, 244.42)
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('Bisque', 283.305, 253.308, 217.756)
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('Black', 0, 0, 0)
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('BlanchedAlmond', 283.305, 261.085, 227.755)
    GO
    --Is there data to migrate?
    SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
    FROM (
    SELECT * FROM SOURCE
    ) S
    --Yes.migrate away!
    --Next line gives a truncation error occurred in Sybase (gives a truncation error occurred in a query tool
    --but fails silently in AseCommand.ExecuteNonQuery).
    INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10)
    SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
    FROM (
    SELECT * FROM SOURCE
    ) S
    select * from dbo.TARGET

    Hi Dave,
    I am consulting internally on this. To my understanding, this behavior is based on the ASE severity level, as returned in the TDS_EED token. AseExceptions are thrown when severity level is 11 or higher.
    Our docs are not explanatory in this regard.  Once I get clarification we will provide something in the form of wiki or KBA or doc bug to further explain the detail.  Apologize for the delay and problems this caused. I guess since the command is aborted by ASE, therefore no insertion occurs, even though ASE indicates truncation occurs prior - makes this confusing.
    The message severity, etc is controlled by ASE and the client is just following suit according to the TDS spec. Its just lacking in the client docs. This can be remedied.
    ASE does provide the option to allow truncation and not abort.  It's a set command:
    Enter a query:
    1 > set arithabort numeric_truncation off
    Enter a query:
    1 > INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10) SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC FROM (SELECT * FROM SOURCE
    ) S
    4 rows Affected.
    Notice though ASE does NOT send truncation message. This is when it is well known and accepted to insert and truncate the numeric data.
    Cheers,
    -Paul

  • Detecting when exception was thrown using custom class loader

    Hello all,
    I would like to implement the solution described here - http://stackoverflow.com/questions/75218/how-can-i-detect-when-an-exceptions-been-thrown-globally-in-java - that uses custom class loader in order to detect when an Exeption thrown somewhere in the JVM hosting my app, please note that exceptions might be thrown from 3rd party jars the app is using. So, thanks to help I got from another post, I've managed to code the custom class loader. My question is how can the class loader wrap the original exception, as the methods in ClassLoader deals with classes, not instances. So where should I set the original exception?
    Thanks!
    Edited by: user9355666 on Sep 28, 2010 10:48 PM

    user9355666 wrote:
    I think I'm missing something fundumental, forgive me for being slow...
    This is what I did so far. For the exception wrapper I made a simple class extens Exception that recieve Exception in its ctor and store it. I also subclassed ClassLoader and override its loadClass(). I've registered it as the system classloader. My thinking was to check in that point that if the requested class is instance of Exception and if yes, returning my wrapper class wrapping this exception. But, since loadClass() return class, how can I set in the wrapper the original exception?
    In addition, let's say 2 different places in the code throws NPE, to my understanding the classloader will load NPE only once, so how throwing the NPE in the second time can be detected?you are missing a key point. you should creating a custom implementation of the NPE class which hooks into your detection code in its constructor. from that point forward, anytime any NPE (which is your custom class) is constructed, you can detect it.

  • Exception Thrown when deleting an object

    Hello,
    I am getting the following exception when deleting an object and then
    creating a new one with the same application identity within the same
    transaction. Why is this exception being thrown and how can I avoid this?
    Thanks!
    kodo.util.UserException: Operation attempted on a deleted instance.
    FailedObject:[email protected]a
         at kodo.runtime.JDOState.error(JDOState.java:422)
         at kodo.runtime.PDeletedState.beforeOptimisticRead(PDeletedState.java:80)
         at kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:1343)
         at
    ca.chubbinsurance.pls.model.impl.EndorsementDetailItemImpl.jdoGetchangeType(EndorsementDetailItemImpl.java)
         at
    ca.chubbinsurance.pls.model.impl.EndorsementDetailItemImpl.getChangeType(EndorsementDetailItemImpl.java:150)
         at
    ca.chubbinsurance.pls.endorsement.rule.AbstractRuleTest.getDetailItem(AbstractRuleTest.java:117)
         at
    ca.chubbinsurance.pls.endorsement.rule.WatercraftRuleTest.testActionForIsAddressChanged(WatercraftRuleTest.java:68)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at com.borland.jbuilder.unittest.JBTestRunner.run(JBTestRunner.java:210)
         at
    com.borland.jbuilder.unittest.JBTestRunner.initiateTest(JBTestRunner.java:252)
         at com.borland.jbuilder.unittest.JBTestRunner.main(JBTestRunner.java:558)

    You can't access persistent fields of deleted objects.

  • Exception thrown when using SDK 4.5.1 with debug flash player

    My setup:
    Windows 7
    Flash Builder 4 Premium, Version 4.0 (build 272416), volume license
    SDK 4.5.1
    RIATest 4.3, RIATestAgent4.swc
    I compiled our application using SDK 4.5.1 with these compiler setting:
    -locale en_US -use-network=false  -theme=Halo/halo.swc --keep-as3-metadata Test -define CONFIG::WITH_DEMS  true -define CONFIG::LP_MODULE true -includes  com.mycompany.automationDelegates.MyContainerAutomationImpl  com.mycompany.automationDelegates.MyFirstComponentAutomationImpl  com.mycompany.automationDelegates.MySecondComponentAutomationImpl  com.mycompany.automationDelegates.MyThirdComponentAutomationImpl  -include-libraries "C:\Program Files (x86)\RIATest  4\agent\RIATestAgent4.swc" "C:\Program Files (x86)\Adobe\Adobe Flash  Builder 4\sdks\4.5.1\frameworks\libs\automation\automation.swc"  "C:\Program Files (x86)\Adobe\Adobe Flash Builder  4\sdks\4.5.1\frameworks\libs\automation\automation_dmv.swc" "C:\Program  Files (x86)\Adobe\Adobe Flash Builder  4\sdks\4.5.1\frameworks\libs\automation\automation_agent.swc"
    When I run our application using  the debug 10.2 Flash Player, the following exception is thrown:
    ReferenceError: Error #1065: Variable Scroller is not defined.
    at flash.system::ApplicationDomain/getDefinition()
    at  mx.automation.delegates.containers::ApplicationAutomationImpl/getAutomationChildren()[E:\ dev\4.5.1\frameworks\projects\automation\src\mx\automation\delegates\containers\Applicatio nAutomationImpl.as:266]
    at mx.core::UIComponent/getAutomationChildren()[E:\dev\4.5.1\frameworks\projects\framework\s rc\mx\core\UIComponent.as:12919]
    at  mx.automation::AutomationManager/getAutomationChildrenArray()[C:\work\flex\dmv_automation \projects\automation_agent\src\mx\automation\AutomationManager.as:4895]
    at  com.riatest::CachedAutomationManager2/getAutomationChildrenArray()[C:\WORK\RIATest\Source \agent4\com\riatest\CachedAutomationManager2.as:46]
    at  mx.automation::AutomationManager/getChildrenRecursively()[C:\work\flex\dmv_automation\pro jects\automation_agent\src\mx\automation\AutomationManager.as:1252]
    at  mx.automation::AutomationManager/getChildren()[C:\work\flex\dmv_automation\projects\autom ation_agent\src\mx\automation\AutomationManager.as:1225]
    at com.riatest::CachedAutomationManager/getChildren()[C:\WORK\RIATest\Source\agent4\com\riat est\CachedAutomationManager.as:55]
    at  com.riatest.toolbar::DisplayListTreeDataDescriptor/getChildren()[C:\WORK\RIATest\Source\a gent4\com\riatest\toolbar\DisplayListTreeDataDescriptor.as:74]
    at  com.riatest.toolbar::DisplayListTreeDataDescriptor/hasChildren()[C:\WORK\RIATest\Source\a gent4\com\riatest\toolbar\DisplayListTreeDataDescriptor.as:112]
    at  com.riatest.toolbar::DisplayListTreeDataDescriptor/isBranch()[C:\WORK\RIATest\Source\agen t4\com\riatest\toolbar\DisplayListTreeDataDescriptor.as:117]
    at mx.controls::Tree/isBranch()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Tree.as: 1552]
    at mx.controls::Tree/initListData()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Tree .as:2858]
    at mx.controls::Tree/makeListData()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Tree .as:1330]
    at mx.controls::List/www.adobe.com/2006/flex/mx/internal::setupRendererFromData()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\List.as:1699]
    at mx.controls::List/commitProperties()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\ List.as:896]
    at mx.controls::Tree/commitProperties()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\ Tree.as:1191]
    at mx.core::UIComponent/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\ mx\core\UIComponent.as:8209]
    at  mx.managers::LayoutManager/validateProperties()[E:\dev\4.5.1\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:597]
    at  mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:783]
    at  mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]
    I contacted the folks who make RIATest, and they did their best to debug the problem. Their conclusion is:
    "The stack trace that you posted shows that  ApplicationAutomationImpl/getAutomationChildren calls  ApplicationDomain/getDefinition on line 266 and the call fails with an  error. This most likely indicates a bug in ApplicationAutomationImpl."
    This problem never occurred when we were compiling our code using SDK 3.4.1. What can I do to work around this and continue performing automated tests of our Flash applications?

    Try linking a Scroller into your app.

  • How to fail messsages when timeout exception is thrown in BPM?

    Hi
    In my BPM, if the time out exception is thrown in BPM, in SXMB_MONI, all the inbound messages' staus is 'processed sucessfully' ? How can I make the message fail?  With a red flag  or anything indicating exception?
    In my design I used deadline branch to throw time out exception.And in the exception branch I used control step to cancel the process.

    Hi,
    In my design I used deadline branch to throw time out exception.And in the exception branch I used control step to cancel the process
    If this is what you have designed then increasing the timeout using the above mentioned blogs doesn't seem to be logical:) (BPM will throw the error when the deadline is meet....can't understand how by increasing timeout will help you)....instead of increasing the timeout you can increase the time limit mentioned in the deadline branch itself to ensure that your message will be processed in that particular time limit.
    Since you have reached the timeout it means that desired message processing has failed so better you raise an alert instead of going for a increase in timeout....increasing timeout decreases performance...
    Regards,
    Abhishek.

Maybe you are looking for

  • Can't see design view in DW CS 4 or 2004

    I am very new to DW but I have a template (that I inherited) working in Design View with DW CS 5.5, but can't see it in CS 4 (mac) or MX 2004 PC versions. I want to make it editable so I need the design view. In CS 4 (mac) I can see it correctley in

  • I have an Iphone5 .. thought reported asked for help to find to find my iphone.  this deactived my phone.  how do i get the deactivate 'beacon' turned off?

    I have an Iphone 5.  I thouht I'd lost I phone in an Wal-Mart.   A Wal-Mart clerk was trying to be helpful and got her Iphone and reported it lost and deactivated. Eventually, I found the phone.  It was completely cleared and the phone had a message

  • List of POs without confirmation from a vendor

    Hi, Is there a transaction,  to obtain a list of all the PO's without confirmations from the vendor ? Means that the "Confirmation" area in the PO is blank while there is a confirmation control key and a confirmation needed. Thanks in advance for the

  • Imp/exp stdout language

    Hi all, I am interested in changing language in exp and/or imp log files? Oracle version is 10.2.0.4.0, OS version is Win 2k3R2. I have Oracle DB installed on hungarian-language OS, and when issue an exp command, I get log file on hungarian language.

  • Airport Extreme and USB harddisc indexing?

    Hi... I've just puchased myself an Airport Extreme Base Station, and connected my external USB 2.0 harddrive to it, but there seems to be a problem... Whenever i try to gain access to the drive, it seems that folders with large amounts of data in it