Plot function and read curser values(int​erpolate) programmat​ically

I would like to obtain a plot of the following function and then obtain values of "I" by specifying values of V..i would like the program to spot the value of I when V value is obtained without manually pointing out the curser. I hope someone can help.thank you
Attachments:
eq.JPG ‏10 KB

duplicate post, continue here

Similar Messages

  • Creating a function and passing query value

    I have what I thought was a pretty easy to resolve situation:
    I want to concatenate two query fields, if the 2nd one isn't empty.
    I created a function:
    <cfargument name="q1" value='#query.q1#' />
    <cfargument name="q1a" value='#query.q1a#' />
    <CFSET variables.myPunct = ": ">
    <cfset variables.ResultVar="">
    <cfif Trim(arguments.q1) NEQ "">
    <cfset variables.ResultVar='#arguments.q1#'>
    </cfif>
    <cfif Trim(arguments.q1a) NEQ "">
    <cfif variables.ResultVar NEQ "">
    <cfset variables.ResultVar='#variables.ResultVar &
    variables.myPunct#'>
    </cfif>
    <cfset variables.ResultVar='#variables.ResultVar &
    arguments.q1a#'>
    </cfif>
    <cfreturn variables.ResultVar>
    This is basically just the example they provide in the online
    instruction, with the names changed.
    In the detail band of my report, I have an expression builder
    field containing: report.mytestfunction()
    When I run this, I get: Element Q1 is undefined in ARGUMENTS.
    I've tried this ninety different ways (literally). It seems
    very clear to me that the query.q1 (for that matter, any of the
    query results) are NOT getting passed to the function. I have tried
    making the expression: report.mytestfunction(query.q1). I have
    tried creating an input parameter.
    The documentation on this is ridiculously limited,
    considering that the ability to implement conditional logic depends
    entirely on the "function", as far as I can tell. I can in no way
    get the function to interface with the query results. If is set
    fixed values in the function, as opposed to trying to use the query
    variables, it outputs fine.
    Any ideas?

    That has got to be the only way I DIDN'T try, although I
    could swear I tried that, too. Maybe I didn't have the "required"?
    I don't know. I know it works now. For the record, FUNCTION:
    <cfargument name="q1" required="yes" />
    <cfargument name="q1a" required="yes" />
    <CFSET variables.myPunct = ": ">
    <cfset variables.ResultVar="">
    <cfif Trim(arguments.q1) NEQ "">
    <cfset variables.ResultVar='#arguments.q1#'>
    </cfif>
    <cfif Trim(arguments.q1a) NEQ "">
    <cfif variables.ResultVar NEQ "">
    <cfset variables.ResultVar='#variables.ResultVar &
    variables.myPunct#'>
    </cfif>
    <cfset variables.ResultVar='#variables.ResultVar &
    arguments.q1a#'>
    </cfif>
    <cfreturn variables.ResultVar>
    In the "Detail" band, called function:
    report.mytestfunction(query.q1, query.q1a)
    Thanks for the tip. I'm going to go take a long walk on a
    short pier now.
    max

  • Plot function and Interpolate Plz Help!!!!

    Im trying to obtain a plot from  the following function ( see attached file)  a I-V curve and then from the plot i wanna determine values for "I" when  values of V are specified. I wanna do this without using cursers but programmatically.(possibly using interpolate functions) .. I hope someone can help me..thanks a lot
    Attachments:
    eq.JPG ‏10 KB

    lil_zu wrote:
    ...is it possible to plot this function without solving?
    No! You cannot plot a function unless you can solve it (either analytically or numerically).
    Do you have an image of how it is supposed to look like?
    What are typical ranges for I and V?
    Do you have a link to a website that explains your application?
    LabVIEW Champion . Do more with less code and in less time .

  • Calling Stored function and showing returned value on the UI screen

    I am calling a stored function by using the following steps mentioned as per the below link. The stored function returns a single scalar value
    http://download.oracle.com/docs/cd/E1790401/web.1111/b31974/bcadvgen.htm#sm0297_
    Please verify if I am putting the code in the classes as required by the ADF framework.
    * 1) In class CustomApplicationModuleImpl extends ApplicationModuleImpl*
    // Some constants
    public static int NUMBER = Types.NUMERIC;
    public static int DATE = Types.DATE;
    public static int VARCHAR2 = Types.VARCHAR;
    protected Object callStoredFunction(int sqlReturnType, String stmt,
    Object[] bindVars) {
    CallableStatement st = null;
    try {
    // 1. Create a JDBC CallabledStatement
    st = getDBTransaction().createCallableStatement(
    "begin ? := "+stmt+";end;",0);
    // 2. Register the first bind variable for the return value
    st.registerOutParameter(1, sqlReturnType);
    if (bindVars != null) {
    // 3. Loop over values for the bind variables passed in, if any
    for (int z = 0; z < bindVars.length; z++) {
    // 4. Set the value of user-supplied bind vars in the stmt
    st.setObject(z + 2, bindVars[z]);
    // 5. Set the value of user-supplied bind vars in the stmt
    st.executeUpdate();
    // 6. Return the value of the first bind variable
    return st.getObject(1);
    catch (SQLException e) {
    throw new JboException(e);
    finally {
    if (st != null) {
    try {
    // 7. Close the statement
    st.close();
    catch (SQLException e) {}
    With a helper method like this in place, calling the func_with_no_args procedure shown in Example 37-7 would look like this:
    *2) In class CustomServiceImpl extends CustomApplicationModuleImpl*
    public String callEnvironmentName(){
    return (String) callStoredFunction(VARCHAR2, "CAR_UTIL_PK.get_environment_name()", new Object[] {});
    3) If I have the first two steps correct, I was to display the value returned by method callEnvironmentName() with scalar values like (Development, Production etc) at the footer of each JSFX page. What is the flow I should follow, should I call callEnvironmentName() from some managed bean? Also I want to store it once on first call to some application variable and use that to populate the JSFX pages. Is there a working example. What is the best practice?
    Thanks
    Edited by: user5108636 on Apr 5, 2011 11:58 PM

    Hi John,
    Duplicate alerts are coming for BP_Confirmed as well as one custom event. Earlier I thought there is some issue with my custom event, but when it came for BP_Confirmed also, then i have a doubt something is wrong with the application.
    I have also checked that BP_Confirmed is being raised only once inside the method-BP_CONFIRM of class-cl_crmcmp_b_cucobupa_impl.
    raise event BPConfirmed
      CLASS cl_crm_ic_services DEFINITION LOAD.
      CREATE OBJECT event.
      event->set_name( if_crm_ic_events_con=>gc_bpconfirmed ).
      event_srv = cl_crm_ic_services=>get_event_srv_instance( ).
      event_srv->raise( event ).
    Are you aware of any other place from where this event is getting triggered?
    Thanks for your help!
    Regards,
    Rohit

  • Read contents inside pdf file programmatically in SharePoint

    I have a SharePoint document library, My Requirement is when user add PDF file on the document library the event receiver fire and read contents inside
    pdf file programmatically. After the start workflow according to the result of event receiver.

    If your question is about handling events in apps for SharePoint, see these links:
    http://msdn.microsoft.com/en-us/library/office/jj220048%28v=office.15%29.aspx
    http://msdn.microsoft.com/en-us/library/office/jj220051%28v=office.15%29.aspx
    If what you need is a way to extract text from the PDF inside the event handler, see this example that uses leadtools.
    http://support.leadtools.com/CS/forums/ShowPost.aspx?PostID=43894
    You should use PDF text extractor in your Event Handler code -
    You can use iTextSharp for reading content
    http://www.codeproject.com/Tips/387327/Convert-PDF-file-content-into-string-using-Csharp

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • Function Module to Read attributes value from Classification tab

    Dear Experts ,
    We are using material classification in the material master. Under classification tab of material master , we are maintaining certain characteristics and their corresponding values.
    I want to read those values and use those in one of the report.
    Can you please help me in identifying Function Module which will return the values of all the attributes of that material.
    Thanks in advnce,
    Regards,
    Nikhil

    You can check those details using CT06 transaction.
    FM CLAF_CLASSIFICATION_OF_OBJECTS can be used to retrive the data using program.
        CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
          EXPORTING
            class              = gc_class
            classtext          = 'X'
            classtype          = gc_classtype
            clint              = gc_mmpsk
            features           = 'X'
            language           = sy-langu
            object             = l_object
            key_date           = sy-datum
            initial_charact    = 'X'
            change_service_clf = ' '
            inherited_char     = 'X'
          TABLES
            t_class            = lt_class
            t_objectdata       = lt_objectdata
          EXCEPTIONS
            no_classification  = 1
            no_classtypes      = 2
            invalid_class_type = 3
            OTHERS             = 4.

  • UDF for reading a particular line and storing the value in a variable

    Hi Experts,
    I am reading entire file content in single feild in source data type.I want to write a UDF to seach for a particular pattern(say :25: and store the value after it i.e  34535764778 detination for further use).
    EX: My  sample file and its  has feilds like
    point assured
    Thanks

    Hi since u are using a single field only then u dont need to use any advanced function
    Wel because if u see the formation of the queue u wil find the the whole data is under one context.. and there are not more context changes
    Convert the string to an array and progressively u can check for the four checks if the a<i>=:
    then a[i+]=2 then a[i]=5 and a[i+] =: and then substring the next 7-8 chrac.. hope u understand
    If this also doesnt work wel then u will have to use the Pattern class in Java
    By the way remember that the substring value cant be retained for the next instance of mapping
    Hope u have that in mind...
    Rgds
    Aditya

  • Hiding a table column and its contents yet reading the values

    Hi all,
    hope someone can help as i urgently need a solution for this although its probably more of a javascript and html forms question than a JSP - but i couldnt find a good javascript forum - if any one has come across a good JS and HTML - i would appreciate if you would let me have a url for it - in the meantime as i need this urgentely and most JS sites that i have visted and posted on seem to be useless, i havent got a reply back yet , and since i've always found java sun forum good and helpful thought would post it here - hope no one minds it too much . Thanks in advance for any help with resolving my urgent problem.
    overview of question:
    I need to, using an onclick() event read the contents of the 4th cell in the clicked row and set the value of a hidden element � (not sure what element to use here attribute tag? Or some other - but basically, this needs to also be hidden, as I�m going to use this as one of the parameters to send through as part of the form - )
    explanation of question
    So when I do :-
    <td><netui:label value="{container.item.TELECARERID}"/></td> And using javascript :-
    row.cells[4].innerText;I can read the value and print it to screen as :-
    alert('row.cells[4].innerText)) = ' + row.cells[4].innerText);although at this stage I�m not sure how to now set this value to an element in the form so that I can include this value as part of the submit action of the form.
    However when I do the following, which is closer to what I�m trying to achieve (ie hide the 4th column of the table and its values � but when I just hide the value as in:-
    <td><netui:hidden dataInput="{container.item.TELECARERID}" dataSource="" /></td> I can�t use the above (row.cells[4].innerText;), javascript syntax to get to the value although the value is still in the viewsource of the html page.
    How can I hide this forth column of the table yet get the values of the 4th column and also set it to some element of the form so that it can be submitted with the date range as part of a criteria to search against by the backend server.
    the full code (well... relevant parts)
    Here is all the code:
    <table id="table1" class="tablebody" border="1">
            <tbody>
             <tr>
               <th><rpb:columnHeader field="FIRSTNAME"><i18n:getMessage messageName="first_name"/></rpb:columnHeader></th>
               <th><rpb:columnHeader field="LASTNAME"><i18n:getMessage messageName="last_name"/></rpb:columnHeader></th>
              <th><rpb:columnHeader field="LOGONNAME"><i18n:getMessage messageName="logon_name"/></rpb:columnHeader></th>
              <th><rpb:columnHeader field="TEAM"><i18n:getMessage messageName="team"/></rpb:columnHeader></th>
               <th><rpb:columnHeader field="TELECARERID"><i18n:getMessage messageName="telecarer_id"/></rpb:columnHeader></th>
            </tr>
           </netui-data:repeaterHeader>
           <netui-data:repeaterItem>
            <tr bgcolor="#FFFFFF" onMouseOver="this.bgColor='gold';" onMouseOut="this.bgColor='#FFFFFF';" onclick="selectTeleCarer(this)">
            <td><netui:label  value="{container.item.FIRSTNAME}"/></td>
              <td><netui:label value="{container.item.LASTNAME}"/></td>
             <td><netui:label  value="{container.item.LOGONNAME}"/></td>
           <td><netui:label  value="{container.item.TEAM}"/></td> 
            <td><netui:label value="{container.item.TELECARERID}"/></td>
           </tr>
          </tbody>///////and then I�m trying to using the below sepertaely printed javascript set it to the below hidden attribute so that it can be submitted as part of the form
    <netui:hidden tagId="teleCarerId" dataSource="{actionForm.teleCarerId}" dataInput=""/>
                                 <div>
                             <i18n:getMessage messageName="created_between"/>
                                <netui:textBox tagId="data" dataSource="{actionForm.fromDate}"/>
                                <button id="trigger" onclick="jscalendar/calendar.js">...</button>
                               <i18n:getMessage messageName="and"/>
                                <netui:textBox tagId="data1" dataSource="{actionForm.toDate}"/>
                                <button id="trigger2" onclick="jscalendar/calendar.js">...</button>
                            </div>
                    <br />
                    <netui:button value="Submit" type="submit"/>
                </netui:form>/// the java script is :-
    function selectTeleCarer(row)
        if ( row.style ) {
    row.style.backgroundColor = ('gold' == row.style.backgroundColor)?
    'white' : 'gold';
    //document.form.teleCarerId.value = row.cells[4].innerText;
    alert('row.cells[4].innerText)) = ' + row.cells[4].innerText);
    }

    thanks for the reply,
    but i cant use just html like <input type hidden > as i'm using the struts like framework with the netui tags in weblogic where i need to link the tag value to the form bean to be passed to the server . thus i need to use the netui tag , which doesnt have a name but a tagId instead, so i'm using it like this :
    <netui:hidden tagId="teleCarerId" dataSource="{actionForm.teleCarerId}" dataInput=""/>and then in javascrpit doing:
    //document.form.teleCarerId.value = row.cells[4].innerText;but thats not my problem ()as it probably will work and its only an issue after i resolve the first part of my question:-
    which is how do i hide a cloumn in a table and its values so that when the user selects a row i can pass the hidden value of row as part of my form .
    as i mentioned before when i make the cloumn visible as in
      <th><rpb:columnHeader field="TELECARERID"><i18n:getMessage messageName="telecarer_id"/></rpb:columnHeader></th>and give it a visible value:
      <td><netui:label value="{container.item.TELECARERID}"/></td>
           </tr>i can pick up the value fine using the javascript syntax:
    row.cells[4].innerText;however when i hide only the value - which is only part of what i want to do as i want to also hide the column heading so that this part of the table isnt seen- as in:-
    <td><netui:hidden dataInput="{container.item.TELECARERID}" dataSource="" /></td>then i cant use
    row.cells[4].innerText;to pick up the value although it does hide the value and in viewsourec the value is there - is there some other syntax that i should be using here - and also how can i hide the cloumn heading so that the table looks asthtically good on the browser?
    ie. what should i change this line of code to?
      <th><rpb:columnHeader field="TELECARERID"><i18n:getMessage messageName="telecarer_id"/></rpb:columnHeader></th>thanks in advance for any help.

  • Is it possible to read the contents of an Excel cell in DIAdem and assign its value to a variable in a VBS script.

    Hi All,
    Initially I thought this little problem would be relatively straight forward but now I’m not so sure. I am familiar with the mechanism by which DIAdem communicates with Excel and how to change the contents of a cell via a VBS script. In my task the contents of the cell in the first row, first column of MyProblem.xls contains the text “DIAdem”. I would like to be able to read this value and assign it to the variable MyString. I originally thought of doing something simple like this:
    Dim MyString
    Dim Excel, ExcelSheet
    Set Excel = CreateObject(“Excel.Application”)
    Excel.Workbooks.Open(“C\MyProblem.xls”)
    Set ExcelSheet = Excel.Workbooks(“MyProblem.xls”).Sheets(“Sheet1”)
    MyString = ExcelSheet.Cells(1,1)
    At this point I would have hoped that MyString would have been set equal to “DIAdem” and I could have used MyString to change the name of a channel in the data portal if I desired using the following code:
    Data.Root.ChannelGroups(1).Channels(1).Name = MyString
    Doesn’t seem to work though. I’m guessing it is because MyString has not picked up the value of the contents of the cell? Can anybody propose a solution to my problem or indeed confirm whether what I am proposing to do is technically feasible.
    Thanks in advance for any responses.
    Matthew

    Hi Matthew,
    Just staring at your ActiveX code, it looks fine to me.  My first thought is that this should work as you outlined it, and I've done this sort of thing many times, so I know it can work.  My second thought though, is that what you probably really want is a DataPlugin and not a VBScript.  Then you could just drag&drop the Excel file into the Data Portal and load all the properties and channels you want from the Excel file.  If you have DIAdem 2010 or later you can use the SpreadSheet reader object in the DataPlugin to avoid the Excel ActiveX functions (and Excel's jealously with other applications trying to read a file it has open already).
    Feel free to send me a few sample Excel files and describe what you want to load from the various cells, and I'd be happy to help you get a DataPlugin written to load your data.  You can also email me at [email protected]
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Logic of array and plotting functions?

    Hi,
    I started to build versatile acquisition programn with labview (with NI cards it seemed to be the best option) and it took quite an effort to adjust the way of thinking while shifting from other programming environments. I start to see the logic behind the labview but I have serious difficulties on figuring out how the labview's array and plotting functions work. Here's a simple example for replacing array subset and plotting it, which just doesn't work as i'd expect. I thought this would first initialize 10 rows, 1000 cols matrix of which the certain row would be replaced (zero padding when new row is longer than the original). The resulting matrix would then be displayed each row having its own windows in the stacked plot. It seems to do something totally different...
    Attachments:
    koe4.vi ‏303 KB

    As you noticed, "Replace Array Subset" can only replace array elements that exist. If it's not there, there's nothing to replace.
    What you'll need to do is make the array larger by using the "Insert into Array" function. Use this function cautiously though. It requires LabVIEW to dynamically reallocate memory while the program is running, and takes time. If you only do the 'Insert' when needed, you should be OK.
    Use the "Array Size" function to get the size of the array to be inserted, then you can choose between the ‘Insert’ or ‘Replace’ functions.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Functions to read and display an array of integers

    Hi guys,
    I am trying to implement with a class called Sort a function to read in an array of integers from a file and a function to display that array.
    public class Sort
         public static int[] read(String file) throws IOException
            /* Create Reader object to read contents of file */
            BufferedReader br = new BufferedReader(new FileReader(file));
            /* Read file and store lines in ArrayList */
            ArrayList<Integer> list = new ArrayList<Integer>();
            /* Variable */
            String in;
            /* While not equal to null reads data from file */
            while ((in = br.readLine()) != null)
                /* Adds data from file to ArrayList */
                list.add(Integer.parseInt(in));
            /* Converts ArrayList into an array */
            int[] array = new int[list.size()];
            for(int i = 0; i < list.size(); i++)
                /* Get array elements */
                array[i] = list.get(i);
            /* Returns array */
            return array;
        public int display()
            for (int i = 0; i < list.size(); i++)
                System.out.println(list.get(i));
    }I am having one of those moments when you forget everything, I need help with display the array in a seperate function, will someone help me please?
    Thanks!

    I know that its just implementing it.
    I have:
    public void display()
            for(int i = 0; i < array.length; i++)
                System.out.println(array);
    But I'm lost on how to make this work, i.e it says "cannot find array variable". I've not done Java for a while and feel like I have forgot everything!
    Edited by: mbruce10 on Nov 15, 2009 1:31 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • *A join in the primary read function may have caused values to be duplicate

    There are two logical services - Emp and Dept with getById function defined in each.
    I need to design a solution; where in the user will enter the EmpId and data to update (both emp and dept table)
    Structure:
    Emp:
    Id,Name, DeptId
    Dept
    Id,Name
    Approach followed (Integration Layer)
    declare function tns:getData($id as xs:string) as element(ns1:Details)* {
    for $EMP in emp:getEmpById($id)
    for $DEPT in dep:getDeptById($EMP/DEPTNO)
    return
    <ns1:Details>
    <ns1:Emp> <ns1:Id>{fn:data($EMP/NAME)}</ns1:Id>
    </ns1:Emp>
    <ns1:Dept> <ns1:Name>{fn:data($DEPT/DNAME)}</ns1:Name>
    </ns1:Dept>
    </ns1:Details>
    Now , when I create the Update Map Procedures; following Error is generated
    A join in the primary read function may have caused values to be duplicated in the result. Update function is disabled.
    I tired to look upon the internet; got some docs. bt couldnt figure out how to resolve this
    Any help is appreciated
    Rgds,
    Is
    Edited by: Is916 on Feb 18, 2010 11:23 PM

    The message is telling you that the values of $EMP/NAME will be duplicated (for each $DEPT). And I'm assuming you're going to say "no they are not, since getDeptById(deptNo) returns zero or one $DEPT". But I suspect you haven't indicated that in the signature of getDeptById(deptNo). I suspect the signature looks like getDeptById( ... ) as element( dept )* - the * indicates zero or more. It should be a question mark instead of the start - indicating zero or one. You should also change the signature of getData to indicate it returns element(ns1:Details)? - since it too is going to return exactly zero or 1.
    Also - please read the Best Practices announcement in this forum. parameterizing function like getEmpById(id) is not recommended. Just have getEmp() - and if you want "by id" then add a predicate .... for $emp in emp:getEmp() where $emp/ID = $id

  • Programmatically changing x axis and reading y axis value of multiplot cursor on xy platform

    Hi Wonder if it is achievable. I had a go but failed!
    I cant create multiplot cursor xy graph from properties list. However it seems to be possible using cursor legend. Which is fine for my application as cursor could be created once and i do not require to show cursor legend. However, I do need to read each value of plot into numeric indicators (not cursor legend) especially when x scale is moved along the graph. Is it possible or am I asking too much?
    Best Regards
    K Waris

    Read the post just before this one! (Its mine, migth help you)

  • Reading lock and pk column values

    Hi!
    I was wondering whether it is possible to somehow read the value a
    persistent object has for its lock column (JDOLOCKX by default) and pk
    column (with datastore identity, JDOIDX by default).
    Especially reading the lock would be useful. My specific problem is this:
    in J2EE environment when a persistent object is serialized and given to the
    web (or any other ui-) layer to display, its identity is lost. There are
    nice examples for solving this problem in the documentation so this is not
    an issue. However, there is no easy way to determine whether someone else
    changed the same data while it was being watched (and modified) on the web
    page. So, in essence, this is an optimistic transaction. However, to use
    optimistic transactions one would have to use stateful session beans. And
    if I am correct, an optimistic transaction has to have a live persistence
    manager all the time, so this is not acceptable unless the
    persistencemanager releses its sql connection in between calls. I don't
    think it does, or does it? And anyhow, I'd prefer using stateless session
    beans.
    It would be quite easy to implement some sort of timestamp mechanism by
    inserting a persistent field for it and updating its value by using
    InstanceCallback interface. However, as the JDOLOCKX column already exists
    it would be nice not to reinvent the wheel.
    The pk value I would need in case the same db is used by many apps (not
    all in Java) and they need to communicate some information about a specific
    object stored in the db (in which case it would be easiest to give the pk
    value to identify an object). Again, I could use ApplicationIdentity or
    make some field where to store some unique value, but I'd prefer using the
    pk value since it is already there (and would not like to use Application
    Identity just because of this).
    Any other solutions to the above problems besides being able to read the
    JDOIDX and JDOLOCKX values are welcome, too.
    -Antti

    You can either parse the toString () generated from
    JDOHelper.getObjectId () or cast it to ObjectIds.Id (in 2.5.x) or Id (in
    3.0) to get the pk value.
    You can also retrieve the lock version in the same fashion.
    In Kodo 3:
    KodoHelper.getVersion (yourPC).
    In Kodo 2.5.x:
    ((PersistenceManagerImpl) pm).getState (JDOHelper.getObjectId
    (yourPC)).getVersion ();
    Antti Karanta wrote:
    On Tue, 14 Oct 2003 10:46:56 -0400, Patrick Linskey
    <[email protected]> wrote:
    Based on your description of your problem, you might want to look at the
    new attach/detach functionality in Kodo 3.0:
    http://solarmetric.com/Software/Documentation/3.0.0RC2/docs/ref_guide_detach.html
    This functionality is a preview of a proposed JDO 2.0 feature, and is
    targeted at exactly the use case that you've described.Yes, it definitely looks nice. One thing it does not mention, though:
    is the String stored in the detached-objectid-field just the (string
    version of the) primary key or is there something else there?
    And what about a case where I do not want a detachable instance, just
    want to be able to have the primary key value?
    And I take it there is no way to read these values (lock and pk) in the
    present version of Kodo?
    On Tue, 14 Oct 2003 18:38:21 +0300, Antti Karanta wrote:
    Hi!
    I was wondering whether it is possible to somehow read the value a
    persistent object has for its lock column (JDOLOCKX by default) and
    pk column (with datastore identity, JDOIDX by default).
    Especially reading the lock would be useful. My specific problem is
    this: in J2EE environment when a persistent object is serialized and
    given to the web (or any other ui-) layer to display, its identity is
    lost. There are nice examples for solving this problem in the
    documentation so this is not an issue. However, there is no easy way
    to determine whether someone else changed the same data while it was
    being watched (and modified) on the web page. So, in essence, this is
    an optimistic transaction. However, to use optimistic transactions
    one would have to use stateful session beans. And if I am correct, an
    optimistic transaction has to have a live persistence manager all the
    time, so this is not acceptable unless the persistencemanager releses
    its sql connection in between calls. I don't think it does, or does
    it? And anyhow, I'd prefer using stateless session beans.
    It would be quite easy to implement some sort of timestamp mechanism
    by inserting a persistent field for it and updating its value by
    using InstanceCallback interface. However, as the JDOLOCKX column
    already exists it would be nice not to reinvent the wheel.
    The pk value I would need in case the same db is used by many apps
    (not all in Java) and they need to communicate some information about
    a specific object stored in the db (in which case it would be easiest
    to give the pk value to identify an object). Again, I could use
    ApplicationIdentity or make some field where to store some unique
    value, but I'd prefer using the pk value since it is already there
    (and would not like to use Application Identity just because of this).
    Any other solutions to the above problems besides being able to read
    the JDOIDX and JDOLOCKX values are welcome, too.
    -Antti
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

Maybe you are looking for