Updating PK with same value - effect on CASCADE UPDATE

Hello,
I would like to understand how sql server 2008 deals with cascade updates
For example I have
Parent table: Employee with column Id as varchar(20) primary key
Child table with IdEmployee as varchar(20) foreign key
I set up Cascade Update for those two tables, meaning any change to primary key in Employee table will cause update in child table rows that match affecting Id
Scenario 1:
Update Employee
set Id = 'ABC',
Name = 'something new'
where Id = 'CCC'
Result of child table: all rows with foreign key IdEmployee and value of 'CCC' are updated. Expected behavior.
Scenario 2:
Update Employee
set Id = 'ABC',
Name = 'something new 2'
where Id = 'ABC'
This time, i am doing something different. I am beside update of column Name with new value, also update primary key but
with SAME value
Question is: what is going to happen to child rows? Are they ALL going to UPDATE due to CASCADE UPDATE
So far, what i did in order to find solution is:
1. I put an timestamp column in child table that should update each time row gets updated
2. I put a trigger for update event on child table that will write something to some log table
*After I set up those two I ran example like above just to be sure timestamp gets changed as well trigger is being fired
Results of updating PK with same value:
1. Timestamp didnt change
2. Trigger didnt fire
Is this enough to make conclusion that updating primary key with same value ALONG with updating some other columns won't
affect child tables with UPDATE CASCADE ON
Update:
Database is CI AS collation
If i do following
Update Employee
set Id = 'abc',
Name = 'something new'
where Id = 'ABC'
1. Timestamp will change
2. Trigger will fire
Conclusion: Case sensitive is important here!
Thank you very much in advance
Milos

>>  would like to understand how sql server 2008 deals with cascade updates <<
Your posting has a number of conceptual errors. 
1. The terms “parent” and “child” are not RDBMS; they are used in network databases. We have “referenced” and “referencing” tables; they can be the same table.
2. A table models a SET of things, so there is no “Employee” table unless you truly have a one-man company. We want a collective or plural name for the SET/table. A better name is “Personnel” for this table. 
3. Her is no such thing as a generic “id” in RDBMS; it has to be “<something in particular>_id” to be valid. Identifiers are usually fixed length 
4. It is very, very rude not to post DDL on a forum. You also do not know the ISO-11179 Rules for data element names. They do not change names from table to table! Does your name change whenever you use it in a new place?? NO! Same principle with data. 
5. The ISO standard uses “<property>_<attribute property>” syntax, no the old PascalCase.
6. Why did you post a useless narrative? How do we compile “I SET up Cascade UPDATE for those two tables,..” to test it?? 
CREATE TABLE Personnel
(emp_id CHAR(20) NOT NULL PRIMARY KEY,
 emp_name VARCHAR(25) NOT NULL,
CREATE TABLE Health_Plan
(health_plan_acct CHAR(20) NOT NULL PRIMARY KEY,
 emp_id CHAR(20) NOT NULL 
 REFERENCES Personnel(emp_id)
 ON UPDATE CASCADE
 ON DELETE CASCADE,
Scenario 1:
UPDATE Personnel
   SET emp_id = 'ABC',
       emp_name = 'something new'
 WHERE emp_id = 'CCC';
Result of child table: all rows with foreign key emp_id and value of 'CCC' are updated. Expected behavior.
Scenario 2:
UPDATE Personnel
   SET emp_id = 'ABC',
       emp_name = 'something new 2'
 WHERE emp_id = 'ABC';
This time, I am doing something different. I am beside UPDATE of column emp_name with new value, also UPDATE PRIMARY KEY but
with SAME value.
>> Question is: what is going to happen to child [sic: referencing]  rows? Are they ALL going to UPDATE due to CASCADE UPDATE. <<
SQL uses a set-oriented model, so the whole table is updated as a unit of work in theory. 
So far, what I did in order to find solution is:
>> I put an timestamp column in child [sic: referencing] table that should UPDATE each time row gets updated <<
Why? It is not in the SET clause list; it cannot change. As an aside,  The T-SQL TIMESTAMP is not the ANSI/ISO TIMESTAMP; it is DATETIME2(n) in T-SQL. The old TIMESTAMP is being deprecated because it stinks both in concept and implementation. 
>> I put a trigger for UPDATE event on child [sic: referencing] table that will write something to some log table.<<
TRIGGERs are fired by what is called a “database event” shown in the ON [DELETE | UPDATE] clause. T-SQL adds INSERT as an event. An update to any value or to no value at all is still an update. Depending on the collation, case may or may not matter in the final
outcome. 
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

Similar Messages

  • Clearing WHT on advance & Invoice with same value

    Hi SAP Gurus
    Could anybody suggest me what transaction code to be used or need any configuration change for clearing both the doc i.e. WHT deduct on advance payment with WHT deducted on Invoice with same value.
    In this scenario no further payment should be made.
    I have linked both the doc through TCode F-54 and try to clear both the doc with TCode F-44 but in this transaction no tds has been reveresed by the system and showing difference.
    In Partial advance payment the system has automatically reversed the TDS. No problem occured in this scenario.
    Regards
    Aman
    Edited by: Amandeep Garg on Mar 17, 2008 10:43 AM

    Hi Ahmed
    Thanx for your response...............
    But I have already used the same. Is there not any transaction other than F-53 in which bank is not  invovled.
    Regards
    Aman

  • Help - loading updated files with same name

    CS4
    When updating files with same name my CS4 automatically puts an extension _000
    I think it should ask me if I want to replace the existing file.  Is there a switch or setting that I need to change?
    Thanks.
    Alan

    Please find the solution in thread, http://forums.adobe.com/thread/707897?tstart=0.
    Hope this helps you.

  • JTree + FK with same value causing problems

    Hi
    I can't figure this out. If I create biz components for 2 tables having a parent-child relationship and a jTree with appropriate rules, things are ok only if the parent's id are of different values than the child. When parent.id and child.id have the same values the jTree seems to recursively fire valueChanged() at strange times.
    Example:
    CREATE TABLE PARENT
    PARENT_ID NUMBER CONSTRAINT PARENT_ID_NN NOT NULL,
    PARENT_NAME VARCHAR2(40 BYTE),
    CONSTRAINT PARENT_C_ID_PK
    PRIMARY KEY
    (PARENT_ID)
    CREATE TABLE CHILD
    CHILD_ID NUMBER CONSTRAINT CHILD_ID_NN NOT NULL,
    CHILD_NAME VARCHAR2(40 BYTE),
    PARENT_ID NUMBER,
    CONSTRAINT CHILD_C_ID_PK
    PRIMARY KEY
    (CHILD_ID)
    ALTER TABLE CHILD ADD (
    CONSTRAINT PARENT_FK
    FOREIGN KEY (PARENT_ID)
    REFERENCES PARENT (PARENT_ID));
    INSERT INTO PARENT VALUES (1, 'Parent 1');
    INSERT INTO PARENT VALUES (2, 'Parent 2');
    INSERT INTO PARENT VALUES (3, 'Parent 3');
    INSERT INTO CHILD VALUES (100, 'Child A', 1);
    INSERT INTO CHILD VALUES (200, 'Child B', 2);
    INSERT INTO CHILD VALUES (300, 'Child C', 3);
    I use the JDev 10.1.2 wizard to create biz components and test the AppMod to make sure the link works. Now I create a blank panel and drag over the ParentView data control. Using the jTree tree binding editor I create two rules:
    1) DataCollectionDef.ParentView - DisplayAttribute.ParentName - BranchRuleAccessor.ChildView
    2) DataCollectionDef.ChildView - DisplayAttribute.ChildName
    Now I add a tree selection listener:
    jTree1.addTreeSelectionListener(new TreeSelectionListener()
    public void valueChanged(TreeSelectionEvent e)
    DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
    if (selectedNode != null)
    System.out.println(selectedNode.getUserObject().toString());
    When I run my panel and watch in JDev everything is fine, i.e. nothing is printed to the screen when it first loads and when I click a node, the correct UserObject prints.
    Here's the rub, now I close the panel and update my child table as follows:
    UPDATE pdssuser.child SET child_id = 1 WHERE child_id = 100;
    UPDATE pdssuser.child SET child_id = 2 WHERE child_id = 200;
    UPDATE pdssuser.child SET child_id = 3 WHERE child_id = 300;
    This time, when I run my panel, the console shows that valueChanged() has been fired 3 times on load:
    Parent 1
    Parent 2
    Parent 3
    This behavior is causing problems with my real tree.
    I haven't had any luck finding threads about this. Any ideas?
    Thanks
    John

    ok, last one (i hope)
    The same issue occurs with 10.1.2.1
    ...but changing the location where I add the treeSelectionListener to after setBindingContext() seems to fix the problem.
    The second call to panelBinding.refreshControl() in setBindingContext() (the one after the call to jbinit()) is what fires the valueChanged events. Somewhere in there, DCBindingContainer.java or DCIteratorBinding.java, the treeSelectionListener is hearing that a value changed (maybe due to a query execution?). I guess the jTree1.setModel(...) call in jbinit() simply sets up the tree but the VO queries described in the Branch Rule accessors are executed on the refreshControl.....i'm out of my comfort zone here and may be confusing you with my "troubleshooting" so I'll just tell you my work-around.
    So to fix it I add the treeSelectionListener in my main method (not jbinit()) after the setBindingContext() has been called.
    I still have no idea why the FK triggers this behavior...but at least it's working.
    * the main method
    public static void main(String [] args)
    try
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception exemp)
    exemp.printStackTrace();
    Panel1 panel = new Panel1();
    panel.setBindingContext(JUTestFrame.startTestFrame("DataBindings.cpx", "null", panel, panel.getPanelBinding(), new Dimension(400, 300)));
    panel.revalidate();
    // Now add the treeSelectionListener
    panel.addSelectionListener();
    * the JbInit method
    public void jbInit() throws Exception
    this.setLayout(borderLayout1);
    this.add(jTree1, BorderLayout.CENTER);
    jTree1.setModel((TreeModel)panelBinding.bindUIControl("ParentView1", jTree1));
    // DON'T ADD treeSelectionListener here
    * Add the selection listener to the tree
    public void addSelectionListener()
    jTree1.addTreeSelectionListener(new TreeSelectionListener()
    public void valueChanged(TreeSelectionEvent e)
    DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
    if (selectedNode != null)
    System.out.println(selectedNode.getUserObject().toString());
    }

  • Update column with ROW_NUMBER() value

    I have a column that I would like to update with a ROW_NUMBER() value partitioned by a specific column.
    CREATE TABLE ##tmp (id INT NULL,
    value1 VARCHAR(10),
    value2 VARCHAR(10))
    INSERT INTO ##tmp (value1,
    value2)
    VALUES ('A', 'asdfasdf'),
    ('A', 'asdf'),
    ('A', 'VC'),
    ('B', 'aasdf'),
    ('C', 'sdfgs'),
    ('C', 'xdfbhsdty'),
    ('C', '23sdgfg'),
    ('C', '234')
    -- update the ID column with the values below
    SELECT ROW_NUMBER() OVER (PARTITION BY Value1 ORDER BY Value2),
    Value1,
    Value2
    FROM ##tmp
    I have 14 million records.  Can someone explain the best way to do this?  Does the ORDER BY destroy performance for this many records?
    Thanks!

    CREATE TABLE ##tmp (id INT NULL,
    value1 VARCHAR(10),
    value2 VARCHAR(10))
    INSERT INTO ##tmp (value1,
    value2)
    VALUES ('A', 'asdfasdf'),
    ('A', 'asdf'),
    ('A', 'VC'),
    ('B', 'aasdf'),
    ('C', 'sdfgs'),
    ('C', 'xdfbhsdty'),
    ('C', '23sdgfg'),
    ('C', '234')
    -- update the ID column with the values below
    ; with cte as (
    SELECT ROW_NUMBER() OVER (PARTITION BY Value1 ORDER BY Value2) as RowNumber,
    Value1,
    Value2
    FROM ##tmp
    update cte
    set Id = RowNumber;
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • JCA adapter doesnt update MarkReadColumn with correct value

    Hi,
    I've created a JCA adapter in the SOA suite which polls a certain database. The poll works perfect only during configuration I set it to do a logical delete. My JCA looks like:
    <adapter-config name="SchoolFitListener" adapter="Database Adapter" wsdlLocation="../WSDL/SchoolFitListener.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/DB/SchoolFit" UIConnectionName="SchoolFit" adapterRef=""/>
      <endpoint-activation portType="SchoolFitListener_ptt" operation="receive">
        <activation-spec className="oracle.tip.adapter.db.DBActivationSpec">
          <property name="DescriptorName" value="SchoolFitListener.PollSchoolfitPolltable"/>
          <property name="QueryName" value="SchoolFitListenerSelect"/>
          <property name="MappingsMetaDataURL" value="SchoolFitListener-or-mappings.xml"/>
          <property name="PollingStrategy" value="LogicalDeletePollingStrategy"/>
          <property name="MarkReadColumn" value="MESSAGE_READ"/>
          <property name="MarkReadValue" value="READ"/>
          <property name="MarkUnreadValue" value="UNREAD"/>
          <property name="PollingInterval" value="60"/>
          <property name="MaxRaiseSize" value="1"/>
          <property name="MaxTransactionSize" value="10"/>
          <property name="NumberOfThreads" value="1"/>
          <property name="ReturnSingleResultSet" value="false"/>
        </activation-spec>
      </endpoint-activation>
    </adapter-config>When I look in the log, it does the update only with the wrong value:
    UPDATE POLL_SCHOOLFIT_POLLTABLE SET MESSAGE_READ = ? WHERE (((((((((((((MESSAGE_TYPE = ?) AND (MESSAGE_READ = ?)) AND (EMPLID = ?)) AND (SF_ID = ?)) AND (VOORNAAM = ?)) AND (ACHTERNAAM = ?)) AND (VOLLEDIGE_NAAM = ?)) AND (STRAAT = ?)) AND (HUISNR = ?)) AND (POSTCODE = ?)) AND (WOONPLAATS = ?)) AND (GEBOORTEDATUM = ?)) AND (BSN = ?))
    [2011-06-15T15:34:17.067+02:00] [osb_server1] [TRACE] [] [] [tid: [ACTIVE].ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: 0000J2JW9fx7y0G_yx0FyW1Dvr150008l6,0] [SRC_CLASS: org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism] [APP: JCA Transport Provider] [dcid: ae78371b7bf314eb:253fe233:1306f4ea111:-8000-00000000000149e2] [SRC_METHOD: executeBatchedStatements]      bind => [UNREAD, C, UNREAD, SF9905731, 131983, John, Doe, John Doe, DowningStreet, 79, 57112, NY, 15-3-1994, 1234567890]Can anyone tell me why it does an update with the wrong value?
    Much thanks!

    Found it. Marked too many fields as PK's during wizard so it couldn't find the right row for the update.

  • Update layout with var value

    Hello all.
    I have a dropdown list with values and a button on page1, and I have an layout on page2.
    The problem is that I want that the layout on page2 could be updated depending on the value of page1.
    Could anyone help me!!
    Vitor Ramalho

    you can pass the value of Page 1 to Page 2 via Navigation->SET_PARAMETER(name = 'your_variable' value = 'Value') &
    then based on the value u received from Page 1, update the Page 2. can you be more specific to help you more.
    TO show values in Layout use below syntax:
    <%= your_variable %>
    Note: DOnt forget to set the "Auto" checkbox in Page2 parameter.
    Raja T
    Message was edited by:
            Raja Thangamani

  • I have a new email address and updated it with my apple id/icloud and updated on my iPhone, but i'm getting a pop up to enter my password with my old email address listed for iCloud/Apple id.

    I have a new email address and updated my apple id/icloud  with the new address. I updated on my iPhone, but i'm keep getting a pop up to enter my password with my old email address listed for iCloud/Apple id.  How do I get it to go away?

    Did you create a NEW Apple ID or did you change the email address for your OLD Apple ID? This will affect how you update apps in the future.
    Anyway, go to Settings/iTunes&App Stores, log out, then log in with the new ID.

  • Dimension foreign key on Fact gets updated with same value

    Hi All,
    I'm hoping someone has at least seen this problem and can provide insight.
    Background:
    - We are on OWB 10.2
    - Fact table is Billing_F
    - Fact table has foreign keys to Customer_Dim, SalesOrg_Dim, Time_Dim, etc.
    - Fact table has update mode Update/Insert
    Once in a while, every row in the Billing Fact gets updated with the SAME SalesOrg_Dim foreign key column value. In other words, the data would look like:
    Before:
    Line ID Amt SalesOrg_Key
    1 100 19241
    2 200 21925
    3 140 08585
    After:
    Line ID Amt SalesOrg_Key
    1 100 12345
    2 200 12345
    3 140 12345
    *** The Source tables contain values in the Before table. ***
    We can't reproduce this on a consistent basis. The only way to "correct" the data is to rerun the mapping from source -> staging -> fact again. No other change.
    Please, has anyone else at least experienced this problem? If so, how were you able to fix it permanently?
    Any help is greatly appreciated!
    irene

    Hi Irene
    Difficult to help here without reviewing your mappings/schedule but does SalesOrgKey 12345 represent a particular value e.g. Unknown, Default?
    I suspect it's something to do with your load order in that the data in the dimension is not available/ready when the fact is loaded and therefore a default value is being inserted. When the fact load is rerun I'm guessing the load of the dimension has finished and therefore the key lookup returns the proper keys from the dimension. Is the dimension truncated and reloaded?
    Regards
    Si

  • Grouping consecutive rows with same value?

    Hi
    I have a table in which three columns are:
    ROWID  SHOPNAME
    1      SHOP_C     
    2      SHOP_A     
    3      SHOP_C     
    4      SHOP_C     
    5      SHOP_A     
    6      SHOP_A     
    7      SHOP_C     
    8      SHOP_B     
    9      SHOP_B     
    10     SHOP_E    
    11     SHOP_A     
    12     SHOP_D     
    13     SHOP_D     
    14     SHOP_F     
    15     SHOP_G     
    16     SHOP_F     
    17     SHOP_C     
    18     SHOP_C     
    19     SHOP_C     
    20     SHOP_C      Rowid is a primary key column with unique ids
    Shopname is varchar2 column
    I want to make groupings of every "shopname" value "order by ROWID" such that when there are consecutive rows of same shopname the group remains same and as soon as there is different value in shopname column for the next row the "group" changes.
    below is my desired output is with 3rd column of groupings as follows:
    ROWID  SHOPNAME    Groups
    1      SHOP_C      1
    2      SHOP_A      2
    3      SHOP_C      3 ------> same grouping because Shop name is same
    4      SHOP_C      3 ------> same grouping because shop name is same
    5      SHOP_A      4 ----> different shopname so group changed.
    6      SHOP_A      4 ----> same group as above because shopname is same
    7      SHOP_C      5
    8      SHOP_B      6
    9      SHOP_B      6
    10     SHOP_E      7
    11     SHOP_A      8
    12     SHOP_D      9
    13     SHOP_D      9
    14     SHOP_F      10
    15     SHOP_G      11
    16     SHOP_F      12
    17     SHOP_C      13
    18     SHOP_C      13
    19     SHOP_C      13
    20     SHOP_C      13I want that to be done via analytics, so that I can partition by clause for different shops over different cities
    regards
    Ramis.

    with data(row_id, shop) as
    select 1,      'SHOP_C' from dual union all
    select 2,      'SHOP_A' from dual union all     
    select 3,      'SHOP_C' from dual union all
    select 4,      'SHOP_C' from dual union all    
    select 5,      'SHOP_A' from dual union all     
    select 6,      'SHOP_A' from dual union all
    select 7,      'SHOP_C' from dual union all
    select 8,      'SHOP_B' from dual union all
    select 9,      'SHOP_B' from dual union all
    select 10,     'SHOP_E' from dual union all
    select 11,     'SHOP_A' from dual union all
    select 12,     'SHOP_D' from dual union all
    select 13,     'SHOP_D' from dual union all
    select 14,     'SHOP_F' from dual union all
    select 15,     'SHOP_G' from dual union all
    select 16,     'SHOP_F' from dual union all
    select 17,     'SHOP_C' from dual union all
    select 18,     'SHOP_C' from dual union all
    select 19,     'SHOP_C' from dual union all
    select 20,     'SHOP_C' from dual
    get_data as
      select row_id, shop,
             lag(shop) over (order by row_id) prev_shop
        from data
    select row_id, shop,
           sum(case when shop = prev_shop
                      then  0
                      else 1
                      end
                ) over (order by row_id) grps
      from get_data;
    ROW_ID SHOP   GRPS
         1 SHOP_C    1
         2 SHOP_A    2
         3 SHOP_C    3
         4 SHOP_C    3
         5 SHOP_A    4
         6 SHOP_A    4
         7 SHOP_C    5
         8 SHOP_B    6
         9 SHOP_B    6
        10 SHOP_E    7
        11 SHOP_A    8
        12 SHOP_D    9
        13 SHOP_D    9
        14 SHOP_F   10
        15 SHOP_G   11
        16 SHOP_F   12
        17 SHOP_C   13
        18 SHOP_C   13
        19 SHOP_C   13
        20 SHOP_C   13
    20 rows selected

  • Query to insert a row in a table with same values except 1 field.

    Suppose I have a table with 100 columns(fields).
    I want to insert a row with 99 fileds being the same as previous ones except one fileld being different.
    The table doesn't have any constraints.
    Kindly suggest a query to solve the above purpose..

    And for much more lazy people, a desc of table is shorter to write. :-)
    Then copy & paste into any editor, then mode column to add a comma after every column name in one shot.Or have the system do it for you. Be lazy.
    SELECT Column_Name || ',' FROM User_Tab_Columns where Table_Name = '';
    Indeed, it can be converted to a script called desc(.sql)
    SELECT Column_Name || ',' FROM User_Tab_Columns where Table_Name = '&1' ORDER BY Column_Id;
    Then desc or @desc.

  • TOP N analysis with same values

    Dear Members,
    Suppose we have the following data in the table Student.
    Sname GPA
    Jack 4.0
    Smith 3.7
    Rose 3.5
    Rachel 3.5
    Ram 2.8
    I have seen many questions in this forum which gives good queries for TOP N analysis. But in my case those are not working.
    There are total 5 students. I should write a query which should take an input and should give the students with top gpa as output in desc order.
    Suppose if i give 4 as input i must get 4,3.7,3.5,3.5,2.8Gpa's since we have 2 gpa's which are same. Suppose i give 3 as the input i must get 4,3.7,3.5 and 3.5 GPA's.
    The query must consider the GPA's which are same as one not different. How can we achive this. i.e the top three students (suppose input is 3) must be
    Jack 4.0
    Smith 3.7
    Rose 3.5
    Rachel 3.5
    It must also include Rachel.
    Any help is greatly appreciated.
    Thanks
    Sandeep

    SQL> select * from test;
    NAME                        GPA
    Jack                          4
    Smith                       3.7
    Rose                        3.5
    Rachel                      3.5
    Ram                         2.8
    SQL> select name,gpa
      2  from
      3    (select name,gpa,dense_rank() over(order by gpa desc) rn
      4     from test)
    5 where rn <= 3
      6  order by rn;
    NAME                        GPA
    Jack                          4
    Smith                       3.7
    Rose                        3.5
    Rachel                      3.5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Purchase info record with same values

    Hi,
    I want to create purchase info records with the same material vendor purchasing org. plant ,how can it be done.
    This is required because it is possible for the same vendor to deliver material for the same plant and purchasing organisation.Is there a workaround or any reason for this.
    Regards

    In SAP , this is not possible to have 2 different inforecords for the combinaiton of MaterialVendorPur orgPlantinfo record type
    could you please explain more regarding the requirement ....
    Regards
    Mani

  • PinListener triggers many times with same value, then segfaults

    Hi.
    Trying a simple button listener with RPi connected to a gertboard, whenever I press the button connected to configured GPIO (GPIO3 in this case, since only GPIO2 and GPIO3 seem suitable in order to use internal pullups) I get many notifications. Keeping pressed button raises a segmentation fault very, very soon.
    This is my PinListener implementation:
    public class ButtonListener implements PinListener
        @Override
        public void valueChanged(PinEvent event)
            System.out.println(String.format("Pin %s value changed, now it is %b",
                    event.getDevice().toString(),
                    event.getValue()));
    Sadly, log cannot be captured when there is a segmentation fault, but after many:
    Pin com.oracle.deviceaccess.gpio.impl.GPIOPinImpl@b4900588 value changed, now it is true
    Pin com.oracle.deviceaccess.gpio.impl.GPIOPinImpl@b4900588 value changed, now it is true
    Pin com.oracle.deviceaccess.gpio.impl.GPIOPinImpl@b4900588 value changed, now it is true
    Pin com.oracle.deviceaccess.gpio.impl.GPIOPinImpl@b4900588 value changed, now it is true
    ...i can see on RPi monitor errors like:
    javacall_event_send: write of message size failed : Resource temporarily unavailable
    Any suggestions?
    Thanks!

    Connection is made through gertboard: you can find schematics here: https://dl.dropboxusercontent.com/u/7414592/JavaME/Assembled%20Gertboard%20Schematics.pdf
    Specifically, I left unconnected (i.e. oopen) P1/CON2 jumper and connected RPi Pin3 (marked as GPIO2 on J2 connector of my board, while it is marked as GPIO0 on schematics, due to pinout revision #2 against #1.
    It seems that the problem comes from Pullup setting, that could cause flickering when floating...

  • How to update iterator with popup values

    Hello all,
    I've got a question regarding updating my iterator tableview (non-mvc bsp application).  I've used some javascripting to open a popup window and retrieve the selected value back into a hidden input field on my cart page.  Now, what I need to do is get the value into the appropriate field in the iterator tableview.  Any ideas?  (Right now, there is no event fired in the cart page after the popup is closed).
    Thanks in advance,
    Lisa

    Hi Lisa,
    You need to fire an event when the popup closes by placing the following in the the cart page:
    <bsp:htmlbEvent id   = "closing_event"
                    name = "closing_event"
                    p1   = "closing_event" />
    This event is fired when you close your popup by using the following JavaScript:
    window.opener.closing_event('POPUP');window.close( );
    Regards,
    Patrick.

Maybe you are looking for

  • Problems removing footer margin area

    Morning/evening all, Probably a simple fix but I can't work it out!... Just below my site's footer I have a white area which is around 5 or 6 px tall by the looks of it. I can see my bg image used to create drop shadow is also being applied to the ar

  • Restful Web Services - First Party Authentication with custom authentication schemes

    Hi I've successfully enabled security using first party authentication on our Restful web services however these only work with the built in Apex accounts and not other authentication schemes. Ideally I'd like to authenticate against LDAP, however wh

  • Alert report in mail

    Hi Experts, SAP provides option out of Office in Messages/Alerts Overview where if someone is out of office all alerts will send to either mail or SMS, but its not working after I'm out of office checbox . Does it require any other setting to activat

  • Error in process in SRM

    Hi Experts, Can anyone tell me hwo to resolve this problem? This is classic scenario, version 4.0 The user has raised a shopping cart without assigning vendor to it, so it has gone error in process as we dont have the Purchase requistion scenario. I

  • Cannot open Public Folder item: "Not enough memory available in Exchange"

    Hi We are running Exchange 2003 Sp2. I cannot open an item in a Public Folder in Outlook that holds a list of contact details - the error message is; "Error: Cannot open this item. There is not enough memory available on Microsoft Exchange to perform