Trying to use the Instance Method

I'm trying to get the second class to use the instance method in the first class to make some Turtles move around in Triangle shape.
Class one code:
public class TryInstanceMethod
private Turtle t;
public TryInstanceMethod(Turtle turtle)
t = turtle;
public void drawTriangle(int length)
t.forward(length);
t.turn(-120);
t.forward(length);
t.turn(-120);
t.forward(length);
Class two code:
import java.awt.*;
public class UseInstanceMethod
public void main(String[] args)
World w1 = new World();
Turtle t1 = new Turtle(w1);
TryInstanceMethod TM1 = new TryInstanceMethod(t1);
TM1.drawTriangle(100);
World w2 = new World();
Turtle t2 = new Turtle(w2);
TryInstanceMethod TM2 = new TryInstanceMethod(t2);
TM2.drawTriangle(200);
it compiles fine but it will not use the instance method drawTriangle to draw two triangles in two different worlds

When posting code highlight it and click the CODE button to retain formatting
fox_1 wrote:
it compiles fine but it will not use the instance method drawTriangle to draw two triangles in two different worldsSo what does it do instead? We do not read minds and cannot see you computer screen. So you need to provide as much information as possible. Such as the Turtle and World classes.

Similar Messages

  • Trying to use the fillInStackTrace method

    Hello,
    The following code generates an error when I try to compile it.
      private void divide() throws Exception
        try
          double a = 50/0;
        catch (Exception error)
          throw error.fillInStackTrace();
    And it's called from:
      void jButton1_actionPerformed(ActionEvent e)
        try
         divide();
        catch (Exception error)
          error.printStackTrace();
      }What's wrong ?
    The error is:
    Error #: 360 : unreported exception: java.lang.Throwable; must be caught or declared to be thrown at line ...
    As you see, I just capture the exception and try to redispatch it.
    Thanks in advance,
    -- Lelio.

    Try this:
    private void divide() throws Throwable
    try
    double a = 50/0;
    catch (Exception error)
    throw error.fillInStackTrace();
    void jButton1_actionPerformed(ActionEvent e)
    try
    divide();
    catch (Throwable error)
    error.printStackTrace();
    The fillInStackTrace throws a Throwable object, which Exception extends, not the other way round. So catching an Exception does not catch a Throwable, but catching a Throwable does catch an Exception.

  • HT201303 last time i bought apps by using visa gift card so iam trying to use the kind of visa gift card and the system is denying the method payment ....any idea how to solve this with my itune account ?

    last time i bought apps by using visa gift card so iam trying to use the kind of visa gift card and the system is denying the method payment ....any idea how to solve this with my itune account ?

    A few reasons I can think of, but instead of shooting in the dark, lets check with experts who can look at your account.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • I can't turn on my MacBook Air despite trying to hold down the power button and using the SMC method. BTW my battery charger lights up to a green when plugged into the laptop.

    I can't turn on my MacBook Air despite trying to hold down the power button and using the SMC method. BTW my battery charger lights up to a green when plugged into the laptop.

    Hello cass528,
    I would be concerned too if my MacBook Air would not power on.  I recommend following the steps in this article when experiencing an issue like this:
    Troubleshooting: My computer won't turn on
    http://support.apple.com/kb/TS1367
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • HT4623 I have tried to update my iPhone using the iTunes method but it will not work. The message "The iTunes update server could not be contacted. Please check your internet connection or try again later," appears. What do I do? The Internet is working f

    I have tried to update my iPhone using the iTunes method but it will not work. The message "The iTunes update server could not be contacted. Please check your internet connection or try again later," appears. What do I do? The Internet is working fine.

    Have you tried the following troubleshooting document?
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    If you end up using the If the iTunes Store opens successfully section of the document, and the "Automatically detect settings" checkbox is already checked, try unchecking and rechecking it and clicking OK.

  • HT1918 First time trying to buy from iTunes and I received a message that my payment was declined. I was using the MasterCard method. Help

    First time trying to buy from iTunes and I received a message that my payment was declined. I was using the MasterCard method. Help

    Is this a debit card you're trying to use? If so, those are apparently no longer accepted by the iTunes Store. You need to use a true credit card. If you are using a credit card, make sure all your billing details match your bank statement exactly. If that doesn't help, call your credit card company and ask if they can see any sort of flag on your account that might cause your card to be declined.
    Regards.

  • LockException when trying to lock the instance before writing.

    hi...
    i am working with entity beans. when i am trying to update the  data from multiple clients at the same time it is giving  exception like...................
    [code]
    java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method updateTest2.
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0.updateTest2(Test2UpdateSessionObjectImpl0.java:140)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0p4_Skel.dispatch(Test2UpdateSessionObjectImpl0p4_Skel.java:157)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception in method in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(java.lang.String).
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:780)
         at in.mobileone.test2.Test2UpdateSessionBean.updateTest2(Test2UpdateSessionBean.java:64)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0.updateTest2(Test2UpdateSessionObjectImpl0.java:122)
         ... 10 more
    Caused by: <b>com.sap.engine.services.ejb.entity.pm.lock.LockException: LockException when trying to lock the instance before writing</b>.
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:87)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeLock(UpdatablePersistent.java:186)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeOperation(UpdatablePersistent.java:209)
         at in.mobileone.test2.Test2EntityBean0PM.setStrFiled2(Test2EntityBean0PM.java:97)
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:755)
         ... 12 more
    Caused by: com.sap.engine.frame.core.locking.LockException: Cannot lock [2007072510571546800000mobileone202.................5791450, %TMP_TEST2              wCGMIA, test2, E]; it is in use by another owner. The lock collision occurred with user admin.
         at com.sap.engine.core.locking.impl3.LockingManagerImpl.lockInternal(LockingManagerImpl.java:154)
         at com.sap.engine.core.locking.AbstractLockingManagerImpl.lock(AbstractLockingManagerImpl.java:420)
         at com.sap.engine.services.applocking.AbstractBaseLocking.lockInternal(AbstractBaseLocking.java:126)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:129)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
         ... 16 more
    ; nested exception is:
         javax.ejb.TransactionRolledbackLocalException: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception in method in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(java.lang.String).
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:780)
         at in.mobileone.test2.Test2UpdateSessionBean.updateTest2(Test2UpdateSessionBean.java:64)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0.updateTest2(Test2UpdateSessionObjectImpl0.java:122)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0p4_Skel.dispatch(Test2UpdateSessionObjectImpl0p4_Skel.java:157)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.services.ejb.entity.pm.lock.LockException: LockException when trying to lock the instance before writing.
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:87)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeLock(UpdatablePersistent.java:186)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeOperation(UpdatablePersistent.java:209)
         at in.mobileone.test2.Test2EntityBean0PM.setStrFiled2(Test2EntityBean0PM.java:97)
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:755)
         ... 12 more
    Caused by: com.sap.engine.frame.core.locking.LockException: Cannot lock [2007072510571546800000mobileone202.................5791450, %TMP_TEST2              wCGMIA, test2, E]; it is in use by another owner. The lock collision occurred with user admin.
         at com.sap.engine.core.locking.impl3.LockingManagerImpl.lockInternal(LockingManagerImpl.java:154)
         at com.sap.engine.core.locking.AbstractLockingManagerImpl.lock(AbstractLockingManagerImpl.java:420)
         at com.sap.engine.services.applocking.AbstractBaseLocking.lockInternal(AbstractBaseLocking.java:126)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:129)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
         ... 16 more
    com.sap.engine.services.ejb.entity.pm.lock.LockException: LockException when trying to lock the instance before writing.
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:87)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeLock(UpdatablePersistent.java:186)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeOperation(UpdatablePersistent.java:209)
         at in.mobileone.test2.Test2EntityBean0PM.setStrFiled2(Test2EntityBean0PM.java:97)
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:755)
         at in.mobileone.test2.Test2UpdateSessionBean.updateTest2(Test2UpdateSessionBean.java:64)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0.updateTest2(Test2UpdateSessionObjectImpl0.java:122)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0p4_Skel.dispatch(Test2UpdateSessionObjectImpl0p4_Skel.java:157)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.frame.core.locking.LockException: Cannot lock [2007072510571546800000mobileone202.................5791450, %TMP_TEST2              wCGMIA, test2, E]; it is in use by another owner. The lock collision occurred with user admin.
         at com.sap.engine.core.locking.impl3.LockingManagerImpl.lockInternal(LockingManagerImpl.java:154)
         at com.sap.engine.core.locking.AbstractLockingManagerImpl.lock(AbstractLockingManagerImpl.java:420)
         at com.sap.engine.services.applocking.AbstractBaseLocking.lockInternal(AbstractBaseLocking.java:126)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:129)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
         ... 16 more
         at com.sap.engine.services.ejb.exceptions.BaseRemoteException.writeReplace(BaseRemoteException.java:276)
         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 java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.engine.services.rmi_p4.DispatchImpl.throwException(DispatchImpl.java:135)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:296)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: javax.ejb.TransactionRolledbackLocalException: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception in method in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(java.lang.String).
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:780)
         at in.mobileone.test2.Test2UpdateSessionBean.updateTest2(Test2UpdateSessionBean.java:64)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0.updateTest2(Test2UpdateSessionObjectImpl0.java:122)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0p4_Skel.dispatch(Test2UpdateSessionObjectImpl0p4_Skel.java:157)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.services.ejb.entity.pm.lock.LockException: LockException when trying to lock the instance before writing.
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:87)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeLock(UpdatablePersistent.java:186)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeOperation(UpdatablePersistent.java:209)
         at in.mobileone.test2.Test2EntityBean0PM.setStrFiled2(Test2EntityBean0PM.java:97)
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:755)
         ... 12 more
    Caused by: com.sap.engine.frame.core.locking.LockException: Cannot lock [2007072510571546800000mobileone202.................5791450, %TMP_TEST2              wCGMIA, test2, E]; it is in use by another owner. The lock collision occurred with user admin.
         at com.sap.engine.core.locking.impl3.LockingManagerImpl.lockInternal(LockingManagerImpl.java:154)
         at com.sap.engine.core.locking.AbstractLockingManagerImpl.lock(AbstractLockingManagerImpl.java:420)
         at com.sap.engine.services.applocking.AbstractBaseLocking.lockInternal(AbstractBaseLocking.java:126)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:129)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
         ... 16 more
    com.sap.engine.services.ejb.entity.pm.lock.LockException: LockException when trying to lock the instance before writing.
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:87)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeLock(UpdatablePersistent.java:186)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.writeOperation(UpdatablePersistent.java:209)
         at in.mobileone.test2.Test2EntityBean0PM.setStrFiled2(Test2EntityBean0PM.java:97)
         at in.mobileone.test2.Test2EntityLocalLocalObjectImpl0.setStrFiled2(Test2EntityLocalLocalObjectImpl0.java:755)
         at in.mobileone.test2.Test2UpdateSessionBean.updateTest2(Test2UpdateSessionBean.java:64)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0.updateTest2(Test2UpdateSessionObjectImpl0.java:122)
         at in.mobileone.test2.Test2UpdateSessionObjectImpl0p4_Skel.dispatch(Test2UpdateSessionObjectImpl0p4_Skel.java:157)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.frame.core.locking.LockException: Cannot lock [2007072510571546800000mobileone202.................5791450, %TMP_TEST2              wCGMIA, test2, E]; it is in use by another owner. The lock collision occurred with user admin.
         at com.sap.engine.core.locking.impl3.LockingManagerImpl.lockInternal(LockingManagerImpl.java:154)
         at com.sap.engine.core.locking.AbstractLockingManagerImpl.lock(AbstractLockingManagerImpl.java:420)
         at com.sap.engine.services.applocking.AbstractBaseLocking.lockInternal(AbstractBaseLocking.java:126)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:129)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
         ... 16 more
         at com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException.writeReplace(BaseTransactionRolledbackLocalException.java:273)
         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 java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         ... 11 more[/code]
    regards
    Guru
    Message was edited by:
            Guruvulu Bojja
    Message was edited by:
            Guruvulu Bojja

    Hi Guru,
    > we need to lock the table when client is accessing so that we can maintain the consistente data
    And that's exactly why the LockException is thrown. If the second client was allowed to update the same data record, this would result in a dirty write which is not allowed by any means. So it's not quite clear what you expect... You lock the data - you get a LockException on concurrent write access - it's so simple and not surprising at all, isn't it?
    What you can probably do is to catch the LockException and retry the operation according to your business logic.
    HTH!
    -- Vladimir

  • Using the ContactInsertOrUpdate method from the ContactWS but error msg rcv

    [This thread was migrated from the On Demand Developer Forum in the old Siebel Community]
    Corsa
    Contributor
    I am getting the following error I do not know why or how to work around
    it.
    Method 'SetFieldValue' of business component 'Contact' (integration
    component 'Contact') for record with search specification '[External <br/>
          System Id] = "123456"' returned the following error:"Access <br/>
    denied.(SBL-DAT-00542)"(SBL-EAI-04375)
    Does any out there have any ideas?
    Previously when I tried to do the same action I got the following message:
    Multiple matches found for instance of integration component 'Contact'
    using search specification '[External System Id] = "123456"' in the
    business component 'Contact', based on user key 'Contact User
    Key:3'.(SBL-EAI-04390)
    Both messages are baffling me. Please, please help
    Product: CRM OnDemand
    06-16-2006 04:35 AM
    Re: Using the ContactInsertOrUpdate method from the ContactWS but error
    msg rcvd
    BigSlick
    Valued Contributor
    Hi Corsa,
    Can you access the record in the online application. Perhaps someone has
    changed the access rights for this Contact on the Contact Team ?
    -BigSlick
    06-20-2006 12:33 PM
    Re: Using the ContactInsertOrUpdate method from the ContactWS but error
    msg rcvd
    Corsa
    Contributor
    I realise now that the field AccountID is readonly and cannot be assigned.
    I was attempting to assign contactsList[count].AccountId to a value . I
    believe, this is the reason I was getting the access denied error.
    06-23-2006 11:10 AM
    ==============================================================================
    Click on the board or message subject at the top to return.

    Ok, so I hit a bump in the road. Just when I think I understand something It doesn't work correctly.
    I implemented it I thought correctly. I looked up something on the sun website (core java) I used advice from here, and my professor finaly responded to me with almost identical instructions. So I did it
    my RationalNumber.java no looks like this.
    public class RationalNumber implements Comparable
    //.....Break to new section
      public  float compute ()
           float value = getNumerator() / getDenominator();
         return value;
       public int compareTo(RationalNumber op2)
           if (Math.abs(compute() - op2.compute()) < .0001)
              return 0; //Equal
          if (compute() > op2.compute())
            return + 1; //Rational Number bigger
          if (compute() < op2.compute())
               return - 1; //Rational Number Smaller
         }I thought that would work fine, but it gives me an error when I compile it:
    RationalNumber.java:8: RationalNumber is not abstract and does not override abstract method compareTo(java.lang.Object) in java.lang.Comparable
    public class RationalNumber implements Comparable
           ^So now what, making it abstract only creates more errors....
    Also, thanks ChuckBing, I'm glad you like the screen name, I've been using it for years.

  • Java process quits while trying to create the instance of COM Object

    Hi All,
    I have a dll file with some API defined. I am trying to use that API using java, so i created a java file with native methods. and created a cpp file in which i am trying to create the instance of the dll file using CreateInstance(__uuidof) method. But the problem is, when the native call tries to execute the CreateInstance(__uuidof) line, jvm quits abruptly, Please suggests me where i am wrong.
    Thanks in advance,

    Be sure that in the current thread you call CoInitialize or CoInitializeEx and on exit Thread you call CoUninitialize.

  • How do I use the find method to find multiple items in a single paragraph?

    I am desigining a script to find any instances where ctrl+b and ctrl+i are applied to body text and then replace those character format overrides with Italic or Bold chartag.  Here's what the script is supposed to do:
    put the find method in a while loop that searches for character format overrides.
    If a character format override is found, pass the text range returned by the find method and the CharPropsChange flag to the GetTextForRange method.
    Use a boolean compare between the idata of the text item to the character angle and character weight constants.
    Whichever boolean evaluates to true, then use the SetTextProp method to set properties of the text range to the properties of the italic or bold character tag.
    This script does work on the first character format override found however it ignores any other overrides in the same paragraph. The cause of this is that the while loop updates the text loc that the find method uses to the next paragraph in flow. I suspect that i need to add an inner loop that goes through all the text in a single paragraph, where at teach iteration the text loc used by the find method is based on the same paragraph but the offset is modified. I am just not sure how to do that.
    function removeOverrides (pDoc)
        var vDocStart = pDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
        var vBoldFmt=getCharFmt (pDoc, 'Bold')
        var vItalicFmt=getCharFmt (pDoc, 'Italic')
        initFA_errno ();
        while (FA_errno==Constants.FE_Success)
            var vTextLoc = new TextLoc(vDocStart,0);
            var vFindParams=findOverrideParams (pDoc);
            var vTextRange=pDoc.Find(vTextLoc,vFindParams);
            if (vTextRange.beg.obj.ObjectValid())
                var vTextItems=pDoc.GetTextForRange (vTextRange, Constants.FTI_CharPropsChange)
                if (vTextItems.length==!0 )
                    if (vTextItems[0].idata==Constants.FTF_WEIGHT)
                       pDoc.SetTextProps (vTextRange, vBoldFmt.GetProps())
                    if (vTextItems[0].idata==Constants.FTF_ANGLE)
                       pDoc.SetTextProps (vTextRange, vItalicFmt.GetProps())
                    } else (Log (vLogFileName, '\nERROR: No items were found in the text format array but format override was found: '+pDoc.Name))
            vDocStart=vDocStart.NextPgfInFlow;
    function findOverrideParams (pDoc)
        var vFindParams = AllocatePropVals(1);
        vFindParams[0].propIdent.num = Constants.FS_FindObject;
        vFindParams[0].propVal.valType = Constants.FT_Integer;
        vFindParams[0].propVal.ival = Constants.FV_FindCharacterFormatOverride;
       return vFindParams;

    Hi Rick,
    Well, following up on the previous posting, I actually did figure out how to make it work but it seems rather inefficient. I can insert a new paragraph right after the paragraph that has the table anchor but when i cut the table, i also cut the paragraph i just created. So to get around that, I create two paragraphs, so that there will be one paragraph left after i do the cut and that is the paragraph that I paste the table into. Once the table is pasted into the new paragraph, I delete the other paragraph that I created.
    Here's the updated code from the for loop:
    var vTbl = vDoc.GetUniqueObject(Constants.FO_Tbl, vTextItems[i].obj.Unique);                 
    var vAnchorPgf=vDoc.NewSeriesPgf (vTbl.TextLoc.obj)      
    var vAnchorPgf2=vDoc.NewSeriesPgf (vAnchorPgf);        
    var vAnchorTextLoc=new TextLoc (vAnchorPgf2, 0);             
    var vTblTextRange=new TextRange ();        
    vTblTextRange.beg.obj=vTbl.TextLoc.obj;       
    vTblTextRange.beg.offset = vTbl.TextLoc.offset;        
    vTblTextRange.end.obj=vTbl.TextLoc.obj;        
    vTblTextRange.end.offset = Constants.FV_OBJ_END_OFFSET                 
    vDoc.TextSelection=vTblTextRange;        
    vDoc.Cut (0);                
    vTblTextRange.beg.obj=vAnchorTextLoc.obj;        
    vTblTextRange.beg.offset = 0;              
    vTblTextRange.end.obj=vAnchorTextLoc.obj;       
    vTblTextRange.end.offset =0;                 
    vDoc.TextSelection=vTblTextRange;       
    vDoc.Paste (0);                   
    vAnchorPgf2.Delete();        

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • Adding a pre-existing podcast to iTunes U using the feed method.

    While trying to add another pre-existing CSULB podcast to our CSULB on iTunes U (using the "feed" method), I encountered an error message that I don't know how to interpret.
    Can you help me with this or is there somebody else at Apple I should work with?
    The pre-existing podcast is at: http://www.ccpe.csulb.edu/citt/podcast/feed.aspx
    The error message reads:
    "While attempting to download. . . iTunes U encountered an authorization error and could not update the content. Verity your authorization access to the feed specified in the feed URL field, including the user name and password permissions, and then try again."
    I have no idea what this means. Can someone please help?
    Walter

    bgerth wrote:
    Is anyone using Podcast Producer 2 to publish content on iTunes U, and if so, does it work reasonably well (do you recommend using it)?
    Its spiffy. I like it, but I'm a softie when it comes to Apple stuff.
    Am I correct in thinking Podcast Producer 2 can only be used to create an RSS feed to point to podcasts stored in its Podcast Library or can you use Podcast Producer to upload files into our institutional iTunes U storage space (yes we are fortunate to have access to Apple's 500 GB storage space)?
    You can choose to do either. Although I haven't seen anything official, I suspect that Apple prefers the use of Podcast Library…but that's just a preference, not any sort of recommendation or future direction. In the end, I suggest (and I think Apple would agree) that you do what makes the most sense for you. For example, we choose to do it both ways.
    Can you provide a link to instructions (or explain how to either identify in iTunes U that the podcast is in Podcast Producer's Podcast Library as an RSS Feed or how to upload the podcast from Podcast Producer to a specific tab in a specific iTunes tab.
    I believe someone (a friend from Apple…??) released a PcP workflow action that deals with iTunes U the same way as PcPv1 did. Overall, though, probably the best kept PcP secret is that Podcast Producer is a generalized workflow solution. Sure, it's cast as a podcasting solution…but if you can get OS X Server to do something, you can get Podcast Producer to turn it into a workflow…anything. Since OS X Server can be scripted to upload content to iTunes U, Podcast Producer can handle that too.
    I appreciate any information given as I have tried with little success to find this information in either the iTunes U or Podcast Producer Admin guides.
    Thanks!!
    BGerth

  • I was trying to use the Matlabscripting VI, but it says it is for instructional purpose and not for research and the system is getting stuck.When I used it two days back it worked.Could U plz tell me what the problem is??

    I have Labview 7.0 and Matlab 6.5 installed on all the computers at my School. When I tried to use the Matllab Scripting Window for the first time, it worked, but after two days when I was trying to run the program, there was a meesage saying that the License is for instructional Purpose only and not for Research or commercial use and the Labview is getting totally stuck. I need the Matlab Scripting VI for my Project,could anyone suggest what I shd do or is there any other method by which I could do that.

    Hello Medha,
    Thank you for contacting National Instruments.
    From the information you have provided, I am not sure what is causing your problem. Make sure that you do not have an evaluation license for LabVIEW.
    What, if anything, was changed in your VI before it stopped working? Will it run without the Matlab script?
    If you continue having trouble getting your VI to work, please respond with more information. If you like, you can post your VI (along with any necessary sub-VIs) and I will take a look at it.
    Have a great day,
    Sean C.
    Applications Engineer
    National Instruments

  • Using the onClick method to change a default text into a CFTEXTAREA

    Hi,
    I am trying to use the simple following method to change the
    value of a Textarea field when the internet user click into the
    field:
    <cftextarea name="fYourMessage" label="Your Message: "
    onclick="if(this.value=='You can use this text field to push a
    personal message for your friend.')this.value='';">You can use
    this text field to push a personal message for your
    friend.</cftextarea>
    But I have no effect at all using that method! I think I am
    missing a knowledge about using CFFORM in a Flash method
    (format="flash") were it might be not possible to use JavaScript in
    the way I want it.
    In any case, if somebody understand what I am trying to do
    and have some information for me, please let me know! I am sure it
    is simple to resolve this!

    Hi,
    Sorry misunderstood the question previously, you should probably use the Embed or Object tag of Html to send FlashVars to the flex application. I just googled and got some links.
    http://kb2.adobe.com/cps/164/tn_16417.htmlhttp://www.mediacollege.com/adobe/flash/actionscript/flashvars.html
    http://www.mediacollege.com/adobe/flash/actionscript/flashvars.html
    Hope this helps.

  • This static method cannot hide the instance method from...

    What means the error message "This static method cannot hide the instance method from Referee"?
    Referee.java is a interface. I implemented it in the class RefereeMyName.java and made a method in that class to be static. Thats why I received that error message.
    But can't I use static methods when I have implemented a interface in that class? I want to have a Player.java class which I want to access RefereeMyName.getTarget(). I cannot use a instance instead because I wouldn't receive a valid return value then (RefereeMyName is the client class).
    What is the solution?

    Hi,
    Well i do not think that you can do that b'cos that way you are not giving the same signature for the method as that exists in the interface. I do not know how other way it can be done but if something urgent for you then you can remove that method from that interface and only define in the class.
    Regards,
    Shishank

Maybe you are looking for

  • BAPI to get the Purchase Order Details

    Hi Folks, Which BAPI is used for retriving the details of a particulare Purchase Order? Please also mention how the same is used? Sample code will be helpful. Thanks Siddarth

  • Having Canvas Playback Problems

    Hello,   I'm a professional user of Final Cut Express 4.  I'm currently working on a video that is relatively simple.  I have a LiveType title that crossfades into a series of interview clips with color correction filters on them.  There is an mp3 fi

  • Customer Workplace (Urgent)

    hi all, I need to know abt customer workplace.......... i means : Customer Workplace (CWP) allows customers access to a clients SAP System. ....... Can anybody help me with the material on the same or any place i can find them Rgds Thnaks in adv.

  • Customize portal "Help" link based on user roles

    Is there a chance to customize the Help link URL in Masthead iView based on user roles? The use case we have is that the "Help" should be different for users of the purchasing company from those of the supplying company. Thanks.

  • Installing error 7

    I just bought an ipod for the first time last night and went to download itunes onto my computer. After much fussing about I finally managed to get the exe for it and got it to install... but then when I tried to start the program it says that it was