Horizontal mapping and query limitation

Hi guys,
Suppose that we have the following inheritance structure:
Class: LegalEntity
Field: LegalEntity relatedTo
Field: String name
Class: Person extends LegalEntity
Field: String ssn
Class: Corporation extends LegalEntity
Field: String location
Class: CollegeStudent extends Person
Field: String school
Class: Employee extends Person
Field: Corporation company
If a flat mapping is used throughout, then we end up with one table
(LEGALENTITY) with the columns: relatedTo, name, ssn, location, school,
and company, plus the Kodo created jdo columns.
If we wanted to create several tables, we could map LegalEntity and
Person horizontally, making the base tables COLLEGESTUDENT, EMPLOYEE,
and CORPORATION.
If I understand section 7.6.4.3 correctly, the value stored in the
relatedto column will be a stringified object identity, and Kodo does
does not support queries across this relation. Thus, the query find all
CollegeStudent objects that satisfies the filter "relatedTo.name ==
\"Sally\"" is not supported.
Did I understand that correctly?
If so, why does this limitation exist?
David

David-
Did I understand that correctly?You are correct.
If so, why does this limitation exist?It is because a proper relation cannot exist in the database if the
target table is unknown (which it is for horizontally mapped classes),
and joins would become tremendously complex or, in some cases, simply
impossible to accomplish with a single SQL statement.
We are considering adding some support for querying across horizontal
relations that are using non-composite primary keys, but it is currently
not possible.
In article <d3eig3$ssb$[email protected]>, David Ezzio wrote:
Hi guys,
Suppose that we have the following inheritance structure:
Class: LegalEntity
Field: LegalEntity relatedTo
Field: String name
Class: Person extends LegalEntity
Field: String ssn
Class: Corporation extends LegalEntity
Field: String location
Class: CollegeStudent extends Person
Field: String school
Class: Employee extends Person
Field: Corporation company
If a flat mapping is used throughout, then we end up with one table
(LEGALENTITY) with the columns: relatedTo, name, ssn, location, school,
and company, plus the Kodo created jdo columns.
If we wanted to create several tables, we could map LegalEntity and
Person horizontally, making the base tables COLLEGESTUDENT, EMPLOYEE,
and CORPORATION.
If I understand section 7.6.4.3 correctly, the value stored in the
relatedto column will be a stringified object identity, and Kodo does
does not support queries across this relation. Thus, the query find all
CollegeStudent objects that satisfies the filter "relatedTo.name ==
\"Sally\"" is not supported.
Did I understand that correctly?
If so, why does this limitation exist?
David
Marc Prud'hommeaux
SolarMetric Inc.

Similar Messages

  • Horizontal Mapping and Flat mapping with Metadata Value Indicator

    Hi
    I have an abstract class B which itself extends another abstract class A.
    There is no table for A. The fields in A are mapped to B. I believe this
    is called "horizontal mapping"
    C and D inherit off B. There's a also a table named B (mapped to class B),
    but none for C or D. Instances of C and D are recorded in table B. I
    believe this is called "flat mapping"
    B has a field foo whose possible values are 'fred' and 'wilma'.
    If foo='fred', then the record is of type C
    If foo='wilma', then the record is of type D
    I believe this is called "class indicator" of type metadata.
    To express this, I have package.jdo which says
    <class name="A"/>
    <class name="B" persistence-capable-superclass="A"/>
    <class name="C" persistence-capable-superclass="B"/>
    <class name="D" persistence-capable-superclass="B"/>
    In B.mapping, I have
    <mapping>
    <package name="domain">
    <class name="B">
    <jdbc-class-map type="horizontal"/>
    <jdbc-class-ind type="metadata-value" column="foo"/>
    </class>
    </package>
    </mapping>
    B.java has a private String foo.
    In C.mapping, I have
    <mapping>
    <package name="domain">
    <class name="C">
    <jdbc-class-map type="flat"/>
    <jdbc-class-ind-value value="fred"/>
    field mappings for C
    </class>
    </package>
    </mapping>
    and similarly in D for value='wilma'
    My questions are...
    1. Is this kind of mapping supported by kodo?
    2. If so, is this configuration correct? I guess not, since I don't
    specify the table name anywhere. Where should it go?
    3. If I remove the "class indicator" mapping and run a simple test I get
    kodo.util.FatalUserException: There is no superclass mapping for mapping
    for "class domain.D".
         at
    kodo.jdbc.meta.FlatClassMapping.assertParentMapping(FlatClassMapping.java:49)
         at kodo.jdbc.meta.FlatClassMapping.getTable(FlatClassMapping.java:85)
         at
    kodo.jdbc.meta.OneToManyFieldMapping.fromMappingInfo(OneToManyFieldMapping.java:87)
         at
    kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:160)
         at
    kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:443)
         at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:949)
    4. If I run a simple test with the horizontal, flat and class-indicator
    mappings, I get
    kodo.jdbc.meta.MappingInfoNotFoundException: The "class-column"
    attribute/extension for the class indicator on type
    "domain.B.<class-indicator>" is missing or names a column that does not
    exist.
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:135)
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:121)
         at
    kodo.jdbc.meta.ColumnClassIndicator.fromMappingInfo(ColumnClassIndicator.java:95)
         at
    kodo.jdbc.meta.RuntimeMappingProvider.initialize(RuntimeMappingProvider.java:135)
         at
    kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository.java:378)
    What am I doing wrong?
    Thanks in advance
    Srini

    I solved this problem by removing the identifier field from the
    class/mapping (kodo support).
    Thanks
    Srini
    Stephen Kim wrote:
    Do you have two fields mapped to the same column? Did you make sure you
    set everything which maps to the column?
    Srinivasan Ranganathan wrote:
    I found what was wrong with this, fixed it and got a different (more
    sensible) error. To correct this mapping, I specified B's mapping type as
    "base" and gave its table and pk names. Also, I moved the common field
    mappings to B.mapping so C.mapping and D.mapping only have fields that are
    specific to each.
    Now when I run a simple test, I get
    testC:
    kodo.util.FatalUserException: Attempt to set column "B.FOO" to two
    different values: (java.lang.Object)"java.lang.Object@2f608ac2",
    (java.lang.String)"fred" This can occur when you fail to set both sides of
    a two-sided relation between objects, or when you map different fields to
    the same column, but you do not keep the values of these fields in synch.
         at kodo.jdbc.runtime.VRow.setObjectInternal(VRow.java(Compiled Code))
         at kodo.jdbc.sql.AbstractRow.setObject(AbstractRow.java(Compiled Code))
         at
    kodo.jdbc.meta.ColumnClassIndicator.insert(ColumnClassIndicator.java:143)
         at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:216)
         at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:219)
         at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:108)
         at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:73)
    testD:
    kodo.util.FatalUserException: Attempt to set column "B.FOO" to two
    different values: (java.lang.Object)"java.lang.Object@2f608ac2",
    (java.lang.String)"wilma" This can occur when you fail to set both sides
    of a two-sided relation between objects, or when you map different fields
    to the same column, but you do not keep the values of these fields in
    synch.
         at kodo.jdbc.runtime.VRow.setObjectInternal(VRow.java(Compiled Code))
         at kodo.jdbc.sql.AbstractRow.setObject(AbstractRow.java(Compiled Code))
         at
    kodo.jdbc.meta.ColumnClassIndicator.insert(ColumnClassIndicator.java:143)
         at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:216)
         at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:219)
         at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:108)
         at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:73)
    I've checked for the two possible errors to the best of my knowledge. Any
    input to resolve this issue is appreciated.
    Thanks in advance
    Srini
    Srinivasan Ranganathan wrote:
    Hi
    I have an abstract class B which itself extends another abstract class A.
    There is no table for A. The fields in A are mapped to B. I believe this
    is called "horizontal mapping"
    C and D inherit off B. There's a also a table named B (mapped to class B),
    but none for C or D. Instances of C and D are recorded in table B. I
    believe this is called "flat mapping"
    B has a field foo whose possible values are 'fred' and 'wilma'.
    If foo='fred', then the record is of type C
    If foo='wilma', then the record is of type D
    I believe this is called "class indicator" of type metadata.
    To express this, I have package.jdo which says
    <class name="A"/>
    <class name="B" persistence-capable-superclass="A"/>
    <class name="C" persistence-capable-superclass="B"/>
    <class name="D" persistence-capable-superclass="B"/>
    In B.mapping, I have
    <mapping>
    <package name="domain">
    <class name="B">
    <jdbc-class-map type="horizontal"/>
    <jdbc-class-ind type="metadata-value" column="foo"/>
    </class>
    </package>
    </mapping>
    B.java has a private String foo.
    In C.mapping, I have
    <mapping>
    <package name="domain">
    <class name="C">
    <jdbc-class-map type="flat"/>
    <jdbc-class-ind-value value="fred"/>
    field mappings for C
    </class>
    </package>
    </mapping>
    and similarly in D for value='wilma'
    My questions are...
    1. Is this kind of mapping supported by kodo?
    2. If so, is this configuration correct? I guess not, since I don't
    specify the table name anywhere. Where should it go?
    3. If I remove the "class indicator" mapping and run a simple test I get
    kodo.util.FatalUserException: There is no superclass mapping for mapping
    for "class domain.D".
         at
    kodo.jdbc.meta.FlatClassMapping.assertParentMapping(FlatClassMapping.java:49)
         at kodo.jdbc.meta.FlatClassMapping.getTable(FlatClassMapping.java:85)
         at
    kodo.jdbc.meta.OneToManyFieldMapping.fromMappingInfo(OneToManyFieldMapping.java:87)
    >>
         at
    kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:160)
    >>
         at
    kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:443)
         at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:949)
    >>
    >>
    >>
    >>
    4. If I run a simple test with the horizontal, flat and class-indicator
    mappings, I get
    kodo.jdbc.meta.MappingInfoNotFoundException: The "class-column"
    attribute/extension for the class indicator on type
    "domain.B.<class-indicator>" is missing or names a column that does not
    exist.
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:135)
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:121)
         at
    kodo.jdbc.meta.ColumnClassIndicator.fromMappingInfo(ColumnClassIndicator.java:95)
    >>
         at
    kodo.jdbc.meta.RuntimeMappingProvider.initialize(RuntimeMappingProvider.java:135)
    >>
         at
    kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository.java:378)
    >>
    >>
    >>
    What am I doing wrong?
    Thanks in advance
    Srini
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Mapping and querying Custom Objects for a Contact with REST Api

    Hello All,
    We are hoping to get some details on managing DataCard set through REST APIs. Our implementation goal is to create Contacts and add Custom object for each Contact, or to be precise, add a DataCard Set for each Contact.
    At the moment, to associate a DataCard Set (or Custom Object) to an existing contact, we are supplying following custom object fields during creation of Custom Object:
    new CustomObjectField 
                                                                    name = "MappedEntityType",
                                                                    dataType = Enum.GetName(typeof(DataType), DataType.numeric),
                                                                    type = "CustomObjectField",
                                                                    defaultValue = "0"
                                                             new CustomObjectField
                                                                    name = "MappedEntityID",
                                                                    dataType = Enum.GetName(typeof(DataType), DataType.numeric),
                                                                    type = "CustomObjectField",
                                                                    defaultValue = "<ContactId>"
    Is this the correct approach? This is Based on the information provided here: http://topliners.eloqua.com/community/code_it/blog/2012/05/31/eloqua-api-how-to-mapping-a-data-card-to-an-entity.
    Would the REST API allow us to query the CustomObjects using the MappedEntityId value for later updates? If so, any pointers on how we approach that?
    Thanks in ad.

    Either the MappedEntityID field is not available or I do it wrong, Eloqua is ignoring the field and does not map the custom record with the unique Contact ID
    {"type":"CustomObjectData","ContactID":"8829509","fieldValues":[{"id":"195","value":"[email protected]"},{"id":"220","value":"a0KJ000000387QvMAI"},{"id":"191","value":"001J000001OrL77IAF"},{"id":"193","value":"NowTV MPP"},{"id":"194","value":"8829509"},{"id":"196","value":"Andreas"},{"id":"197","value":"Wolf"},{"id":"198","value":"003J00000145lkBIAQ"},{"id":"210","value":"777666555"},{"id":"199","value":"gbp"},{"id":"200","value":"0"},{"id":"215","value":"0"},{"id":"201","value":"999111999"},{"id":"214","value":"111111"},{"id":"202","value":"222222"},{"id":"204","value":"now"},{"id":"203","value":"xmas"},{"id":"205","value":"no description"},{"id":"206","value":"test"},{"id":"218","value":"holidays"},{"id":"219","value":"PPV-0878545"},{"id":"213","value":"N"},{"id":"212","value":"myself"},{"id":"209","value":"now tv"},{"id":"192","value":"1417542120"},{"id":"207","value":"1417542120"},{"id":"216","value":"1417542240"},{"id":"217","value":"1417542240"},{"id":"211","value":"1417542240"}]},"MappedEntityID":"003J00000145lkBIAQ"}
    Response
    DEBUG|Response------{"type":"CustomObjectData","id":"81720","fieldValues":[{"id":"195","value":"[email protected]"},{"id":"220","value":"a0KJ000000387QvMAI"},{"id":"191","value":"001J000001OrL77IAF"},{"id":"193","value":"NowTV MPP"},{"id":"194","value":"8829509"},{"id":"196","value":"Andreas"},{"id":"197","value":"Wolf"},{"id":"198","value":"003J00000145lkBIAQ"},{"id":"210","value":"777666555"},{"id":"199","value":"gbp"},{"id":"200","value":"0"},{"id":"215","value":"0"},{"id":"201","value":"999111999"},{"id":"214","value":"111111"},{"id":"202","value":"222222"},{"id":"204","value":"now"},{"id":"203","value":"xmas"},{"id":"205","value":"no description"},{"id":"206","value":"test"},{"id":"218","value":"holidays"},{"id":"219","value":"PPV-0878545"},{"id":"213","value":"N"},{"id":"212","value":"myself"},{"id":"209","value":"now tv"},{"id":"192","value":"1417542120"},{"id":"207","value":"1417542120"},{"id":"216","value":"1417542240"},{"id":"217","value":"1417542240"},{"id":"211","value":"1417542240"}]}
    Eloqua:
    Name: PPV-0878545
    Unique Code: a0KJ000000387QvMAI
    Status Registered
    Created Date 12/22/2014 12:44:49 PM
    Mapped NO
    Any Idea how to map this to a contact
    Entity Type is Contacts
    Entity Field is SFDC Contact ID

  • Horizontal mapping + embedded one-to-one problem

    Hi,
    this message corresponds to the article "Embedded One-to-One mapping
    problem". But this article is more exactly then the first without less
    unnessary information.
    I got an abstract super-class Person which is mapped horizontal.
    Student inherits from Person.
    Person contains an attribute called location(instance of Class Location)
    which should be mapped "embedded one-to-one".
    Since Person is mapped horizontal no table will be used for Person.
    I get following exception when running mappingtool on action "buildSchema"
    kodo.jdbc.meta.MappingInfoNotFoundException: No mapping information was
    found for "xxx.yyy.zzz.persistence.jdo.business.Location.lat"
    I think Kodo tries to map the field "location" since the field is declared
    as embedded. But it can not embed the field since Person is horizontal
    mapped and no table for Person exists where the corresponding field of
    Location could be placed in. Also it is not possible to set the "embedded"
    attribute in the subclass Student for the field "location" because it must
    be specified in the superclass.
    Can you help me ?
    Thanks a lot,
    Felix
    Additional information:
    =======================
    Exception stack trace:
    [mappingtool] kodo.jdbc.meta.MappingInfoNotFoundException: No mapping
    information was found for "xxx.yyy.zzz.persistence.jdo.business.Location".
    [mappingtool] at
    kodo.jdbc.meta.RuntimeMappingProvider.getMapping(RuntimeMappingProvider.java:44)
    [mappingtool] at
    kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository.java:352)
    [mappingtool] at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:307)
    [mappingtool] at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:162)
    [mappingtool] at
    kodo.jdbc.meta.MappingTool.buildSchema(MappingTool.java:646)
    [mappingtool] at kodo.jdbc.meta.MappingTool.run(MappingTool.java:951)
    [mappingtool] at
    kodo.jdbc.ant.MappingToolTask.executeOn(MappingToolTask.java:175)
    [mappingtool] at com.solarmetric.ant.TaskBase.execute(TaskBase.java:105)
    [mappingtool] at
    org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [mappingtool] at org.apache.tools.ant.Task.perform(Task.java:364)
    [mappingtool] at org.apache.tools.ant.Target.execute(Target.java:301)
    [mappingtool] at
    org.apache.tools.ant.Target.performTasks(Target.java:328)
    [mappingtool] at
    org.apache.tools.ant.Project.executeTarget(Project.java:1215)
    [mappingtool] at
    org.apache.tools.ant.Project.executeTargets(Project.java:1063)
    [mappingtool] at org.apache.tools.ant.Main.runBuild(Main.java:632)
    [mappingtool] at org.apache.tools.ant.Main.startAnt(Main.java:183)
    [mappingtool] at
    org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
    [mappingtool] at
    org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
    Here is the JDO-Metadata:
    <?xml version="1.0" encoding="UTF-8"?>
    <jdo>
    <package name="xxx.yyy.zzz.persistence.jdo.business">
    <class name="Location"/>
    <class name="Person" identity-type="application"
    objectid-class="PersonId">
    <field name="location" embedded="true"/>
    <field name="id" primary-key="true"/>
    </class>
    <class name="Student" identity-type="application"
    persistence-capable-superclass="Person"/>
    </package>
    </jdo>
    Here is the mapping-metadata:
    <?xml version="1.0" encoding="UTF-8"?>
    <mapping>
    <package name="xxx.yyy.zzz.persistence.jdo.business">
    <class name="Person">
    <jdbc-class-map type="horizontal"/>
    </class>
    <class name="Student">
    <jdbc-class-map type="base" table="STUDENT"/>
    <jdbc-version-ind type="version-number" column="JDOVERSION"/>
    <jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
    <field name="Person.birthDate">
    <jdbc-field-map type="value" column="BIRTHDATE"/>
    </field>
    <field name="Person.city">
    <jdbc-field-map type="value" column="CITY"/>
    </field>
    <field name="Person.id">
    <jdbc-field-map type="value" column="ID"/>
    </field>
    <field name="Person.location">
    <jdbc-field-map type="embedded"
    null-ind-column="NULL_INDICATOR" synthetic="false">
    <field name="lat">
    <jdbc-field-map type="value" column="LATITUDE"/>
    </field>
    <field name="lon">
    <jdbc-field-map type="value" column="LONGITUDE"/>
    </field>
    </jdbc-field-map>
    </field>
    <field name="Person.name">
    <jdbc-field-map type="value" column="NAME"/>
    </field>
    <field name="Person.picture">
    <jdbc-field-map type="value" column="PICTURE"/>
    </field>
    <field name="Person.state">
    <jdbc-field-map type="value" column="STATE"/>
    </field>
    <field name="Person.street">
    <jdbc-field-map type="value" column="STREET"/>
    </field>
    <field name="Person.zipcode">
    <jdbc-field-map type="value" column="ZIPCODE"/>
    </field>
    </class>
    <class name="Location">
    <jdbc-class-map type="none"/>
    <field name="lat">
    <jdbc-field-map type="none"/>
    </field>
    <jdbc-class-map type="none"/>
    <field name="lon">
    <jdbc-field-map type="none"/>
    </field>
    </class>
    </package>
    </mapping>
    Here are the class definitions:
    Class Location:
    public class Location {
         private int lat;
         private int lon;
    Class Person:
    public abstract class Person {
    private int id;
    private String name;
    private String street;
    private String city;
    private String state;
    private String zipcode;
    private Date birthDate;
    private String picture;
    private Location location;
    Class Person:
    public class Student extends Person {

    You'll probably have much better luck sending this question to
    [email protected]; the newsgroup is generally for quick questions
    about certain features or problems the community might be able to solve
    without input from SolarMetric developers.

  • Horizontal mapping base class query

    Greetings,
    I have a class hierarchy which looks like the following:
    abstract class A {
    int num;
    class B extends A
    class C extends A
    class D extends A
    This hierarchy is horizontally mapped. Say I want to run the following query. Give me the 10 objects of type A (either B,C or D practically) with the highest num. I would run the following query:
    Query query = pm.newQuery("select from A.class range 0, 10");
    query.setOrdering("num descending");
    I would expect this query to return a maximum of 10 results. It in fact returns up to 30 results, i.e. 10 per subclass type. What is wrong in the structure of the query or my classes? Is this expected behaviour and does anyone know how I may remedy this situation?
    Thanks in advance,
    Adam.

    David-
    Did I understand that correctly?You are correct.
    If so, why does this limitation exist?It is because a proper relation cannot exist in the database if the
    target table is unknown (which it is for horizontally mapped classes),
    and joins would become tremendously complex or, in some cases, simply
    impossible to accomplish with a single SQL statement.
    We are considering adding some support for querying across horizontal
    relations that are using non-composite primary keys, but it is currently
    not possible.
    In article <d3eig3$ssb$[email protected]>, David Ezzio wrote:
    Hi guys,
    Suppose that we have the following inheritance structure:
    Class: LegalEntity
    Field: LegalEntity relatedTo
    Field: String name
    Class: Person extends LegalEntity
    Field: String ssn
    Class: Corporation extends LegalEntity
    Field: String location
    Class: CollegeStudent extends Person
    Field: String school
    Class: Employee extends Person
    Field: Corporation company
    If a flat mapping is used throughout, then we end up with one table
    (LEGALENTITY) with the columns: relatedTo, name, ssn, location, school,
    and company, plus the Kodo created jdo columns.
    If we wanted to create several tables, we could map LegalEntity and
    Person horizontally, making the base tables COLLEGESTUDENT, EMPLOYEE,
    and CORPORATION.
    If I understand section 7.6.4.3 correctly, the value stored in the
    relatedto column will be a stringified object identity, and Kodo does
    does not support queries across this relation. Thus, the query find all
    CollegeStudent objects that satisfies the filter "relatedTo.name ==
    \"Sally\"" is not supported.
    Did I understand that correctly?
    If so, why does this limitation exist?
    David
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Nio ByteBuffer and memory-mapped file size limitation

    I have a question/issue regarding ByteBuffer and memory-mapped file size limitations. I recently started using NIO FileChannels and ByteBuffers to store and process buffers of binary data. Until now, the maximum individual ByteBuffer/memory-mapped file size I have needed to process was around 80MB.
    However, I need to now begin processing larger buffers of binary data from a new source. Initial testing with buffer sizes above 100MB result in IOExceptions (java.lang.OutOfMemoryError: Map failed).
    I am using 32bit Windows XP; 2GB of memory (typically 1.3 to 1.5GB free); Java version 1.6.0_03; with -Xmx set to 1280m. Decreasing the Java heap max size down 768m does result in the ability to memory map larger buffers to files, but never bigger than roughly 500MB. However, the application that uses this code contains other components that require the -xMx option to be set to 1280.
    The following simple code segment executed by itself will produce the IOException for me when executed using -Xmx1280m. If I use -Xmx768m, I can increase the buffer size up to around 300MB, but never to a size that I would think I could map.
    try
    String mapFile = "C:/temp/" + UUID.randomUUID().toString() + ".tmp";
    FileChannel rwChan = new RandomAccessFile( mapFile, "rw").getChannel();
    ByteBuffer byteBuffer = rwChan.map( FileChannel.MapMode.READ_WRITE,
    0, 100000000 );
    rwChan.close();
    catch( Exception e )
    e.printStackTrace();
    I am hoping that someone can shed some light on the factors that affect the amount of data that may be memory mapped to/in a file at one time. I have investigated this for some time now and based on my understanding of how memory mapped files are supposed to work, I would think that I could map ByteBuffers to files larger than 500MB. I believe that address space plays a role, but I admittedly am no OS address space expert.
    Thanks in advance for any input.
    Regards- KJ

    See the workaround in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4724038

  • Update maps when roads and speed limits change

    Is there any way to update the maps frequently to get the latest changes to speed cameras, speed limits, road changes etc? Or do you have to reload the map every now and then? I had a TomTom before and every time I connected it to the computer there was several updates installed. I have a N97 btw.
    Former owner of E90, N97 x2, E72, N8 and current owner of E7.

    The best way to update your maps regularly is to delete all maps and then redownload the ones you need using Nokia Map Loader. Maps could be updated up to 4 times a year.

  • Horizontal mapping question

    Hello,
    I have and Person, Post and Organization extending Party class. I map
    Person, Post and Organization class each on its own table
    Now Person and Organization have a bi-directional association with each
    other (via inverted relation) - Organization has a collection of Persons
    and Person references back to Organization
    I would like to know how Kodo will fetch persons for a given organization.
    Will Kodo optimize SQL to not to attempts to query all tables of
    implementations of Party when fetching relation expressed on specific
    subclasses - Organization and Person in this case
    Could you please post some details on horizontal mapping rules and what
    cases are the most expansive in terms of SQL and performance and if there
    are any limitations as far as eager fetching is concerned
    Thank you
    Alex

    Alex,
    Things only get complex if you have relations to the virtual class --
    Party, in this case.
    If you declare a field to be a relation to a subclass, Kodo won't
    attempt to look in the other subclass tables.
    If you query on Party, Kodo will issue three queries -- one for Person,
    one for Post, and one for Organization. This is analgous to Kodo's
    support for queries on interfaces.
    Declaring a relation to Party will be the most expensive, as Kodo will
    not be able to do the join on the database side, but will have to bring
    the OID(s) into the JVM and then do the lookup from there.
    -Patrick
    Alex Roytman wrote:
    Hello,
    I have and Person, Post and Organization extending Party class. I map
    Person, Post and Organization class each on its own table
    Now Person and Organization have a bi-directional association with each
    other (via inverted relation) - Organization has a collection of Persons
    and Person references back to Organization
    I would like to know how Kodo will fetch persons for a given organization.
    Will Kodo optimize SQL to not to attempts to query all tables of
    implementations of Party when fetching relation expressed on specific
    subclasses - Organization and Person in this case
    Could you please post some details on horizontal mapping rules and what
    cases are the most expansive in terms of SQL and performance and if there
    are any limitations as far as eager fetching is concerned
    Thank you
    Alex

  • To disable the horizontal scrollbar and to create a next button to navigate

    To disable the horizontal scrollbar and to create a next button to navigate through the records. At present I create a JSF page and drag and drop my table view and then using the Tuning property I have limited the number of records to be shown. But I need to add a button and then code it to display the next few records. Can someone kindly suggest a suitable mechanism to get this accomplished.
    Edited by: 888970 on Oct 2, 2011 10:15 PM

    Hi Erp,
    At present these are the entries that I have in my JSPX page.
    I have a Table, Iterator and a Input List of Values. As per the scenario, I want a few rows to appear on the table for which I wanted to disable the horizontal scroll bar and then once I click on the list of values it must prompt me with the remaining page numbers.
    Earlier there are about 150 records in the table. I want to show them as 15 per page.
    For which I have added the Iterator and a LOV component code in my JSPX page.
    <af:iterator id="i1"
    value="#{bindings.NsEventDetailsView1.collectionModel}"
    var="row"
    binding="#{pageFlowScope.testPageBean.myIterator}"/>
    <af:inputListOfValues label="Label 1"
    popupTitle="Search and Result Dialog" id="ilov1"/>
    Then I created the bean class as per the example.
    Below is the bean class:
    import javax.faces.event.ValueChangeEvent;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import org.apache.myfaces.trinidad.component.UIXIterator;
    import org.apache.myfaces.trinidad.event.AttributeChangeEvent;
    public class TestPagebean {
    public TestPagebean() {
    public void i1ov1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    private UIXIterator myiter;
    public void setI1(UIXIterator myiter) {
    this.myiter=myiter;
    public UIXIterator getmyiter() {
    this.myiter=myiter;
    public UIXIterator setmyiter() {
    return myiter;
    UIXIterator valueIterator = getmyiter();
    if (!valueChangeEvent.getNewValue().equals(valueChangeEvent.getOldValue())) {
    int newPage =
    Integer.parseInt(valueChangeEvent.getNewValue().toString());
    int pageStart = (newPage) * valueIterator.getRows();
    valueIterator.setFirst(pageStart);
    AdfFacesContext.getCurrentInstance().addPartialTarget(valueIterator);
    But i am getting errors in the bean class.
    1. Block expecting }
    2. public UIXIterator getmyiter() {
    this.myiter=myiter;
    Return Statement missing
    3. Block expecting {
    4. Type or variable 'valueChangeEvent' not found
    5. Method 'getNewValue' not found
    6. Method 'getOldValue' not found
    7. Method 'toString' not found
    Can you suggest a possible solution?

  • Horizontal mapping not working in Kodo 4.1.2

    Hello,
    I am having troubles in trying to get the class mapping I want in Kodo 4.1.2.
    I want to go from Kodo 3.3 to Kodo 4.1, and still in the evaluation process. Basically, all I want is to have my package.jdo files to work in Kodo 4.1, with the minimum modifications, before moving to JPA.
    The mapping is defined is my package.jdo using the <extension vendor-name="kodo" key="jdbc-class-map" value="XXX"/> where XXX can be one of horizontal, base or flat (I dont use vertical in this applicaion). This element does not seem to be properly recognized by the new mapping tool, and all my classes are mapped in the same base table.
    After some digging in the docs and in the examples provided, I found this <inheritance strategy="XXX"/> element, that can be put in my package.jdo file. This is not clearly said in the docs (it seems this element is only mentionned in the new orm DTD), but is used in the sample/jdo/horizontal/package.jdo file.
    Then I modified my package.jdo files, with this new element, where XXX is one of subclass-table, new-table (with no <join/> nested element) or superclass-table. But the result is not the one expected : all the classes are mapped in the same table.
    I then gave a try at the example provided, compiled, enhanced and mapped the sample/jdo/horizontal classes provided with the distribution, since this example covers exactly what I want to do. It seems to me that this example does not work either.
    The package.jdo says :
    <jdo>
    <package name="samples.jdo.horizontal">
    <sequence name="sjvm" factory-class="sjvm" strategy="nontransactional"/>
    <class name="LastModified">
    <inheritance strategy="subclass-table"/>
    </class>
    The mapping file I get says :
    <mapping>
    <package name="samples.jdo.horizontal">
    <class name="LastModified">
    <jdbc-class-map type="base" pk-column="ID" table="LASTMODIFIED"/>
    <jdbc-version-ind type="version-number" column="VERSN"/>
    <jdbc-class-ind type="in-class-name" column="TYP"/>
    <field name="creationDate">
    <jdbc-field-map type="value" column="CREATIONDATE"/>
    </field>
    <field name="lastModificationDate">
    <jdbc-field-map type="value" column="LASTMODIFICATIONDATE"/>
    </field>
    </class>
    The enhancement is made using jdoc, the mapping file is generated using the following command line (the DB is empty) :
    mappingtool -a refresh -f mapping.xml samples.jdo.horizontal.LastModifiedI would expect an horizontal mapping, with a class element containing only a <jdbc-class-map type="horizontal"/> element, as it is the case if I use my Kodo 3.3 mapping tool.
    I tried the enhancement / mapping file generation process with two configuration of the kodo.properties file : the first one with kodo3 as the Mapping Factory and the second with jdo. The result is the same in both cases. I verified by setting the log level to TRACE for the Tool what the factory used. In fact in both case, it is the MappingFileDeprecatedJDOMappingFactory, which seems weird to me.
    Bytheway, setting the MappingFactory to jpa leads to the following IllegalArgumentException during enhancement :
    Exception in thread "main" org.apache.openjpa.lib.util.ParseException: Instantiation of plugin "MetaDataFactory" with value "jpa" caused an error "java.lang.IllegalArgumentException : java.lang.ClassNotFoundException: jpa". The alias or class name may have been misspelled, or the class may not have be available in the class path. Valid aliases for this plugin are: [jdo, kodo3]
    I'd be glad to get any hint if I'm wrong on anything, or any workaround / patch to get my case to work.
    Thank you in advance,
    Jose

    If the same exact app and code works with 4.0 with the same ForeignKeyDeleteAction setting, I suggest that you open a case with support.
    This property hasn't changed since 4.0
    http://e-docs.bea.com/kodo/docs41/full/html/ref_guide_mapping_defaults.html
    Laurent

  • About Java mapping and java proxy

    Hi
    Iam new to Xi and basically iam an ABAPER.When iam dooing mappinps or proxies i cant able to understand the java pari cant (javamapping and java proxies) .I need some notes on java mapping and java proxy which is easy to do.And why do we use this java mapping or java proxy particularly when we r having abap mappipng and abap proxy.
    thanks in advance

    Hi,
    refer
    Java Mapping
    SAP Network Blog: Java Mapping (Part I)
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    Java Mapping in XI
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+mapping&adv=false&sortby=cm_rnd_rankvalue#
    Runtime Environment (Java Mappings) (SAP Library - Partner Connectivity Kit)
    http://help.sap.com/saphelp_nw04/helpdata/en/bd/c91241c738f423e10000000a155106/frameset.htm
    Java Mapping (SAP Library - Partner Connectivity Kit)
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    SAP Network Blog: Testing and Debugging Java Mapping
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    SAP Network Blog: Implementing a Java Mapping in SAP PI
    /people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
    "JAVA MAPPING", an alternate way of reading a CSV file
    /people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file
    SAP Network Blog: XI Java Mapping Helper (DOM)
    /people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    Java Proxy
    Java Proxy Objects (SAP Library - SAP Exchange Infrastructure)
    http://help.sap.com/saphelp_nw04/helpdata/en/c5/7d5e3c754e476ee10000000a11405a/frameset.htm
    Accessing Active Directory through Java Proxy on SAP Exchange Infrastructure 3.0
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10716e9f-23d7-2a10-8c8c-d2665615f8fc
    Thanks
    Swarup

  • About Horizontal mapping !!!

    Hello,
    I want to use the horizontal mapping, I have read the documentation
    several times but no succes until now !!!
    I have managed to use the vertical one and it worked...
    I did add this line in yhe kodo property file:
    kodo.jdbc.SubclassMapping: vertical
    Then in order to use the horizontal mapping I tried to add this line:
    kodo.jdbc.SubclassMapping: horizontal ---> but it did not work.
    then I tried to do this in my package.jdo file:
    <class name="Customer" identity-type="datastore"
    persistence-capable-uperclass="Person">
    <extension vendor-name="kodo" key="jdbc-class-map" value="horizontal"/>
    </class>
    but no succes ...
    what I want is this:
    I have those classes
    class Person
    private String first_name;
    private String last_name
    class Customer extends Person
    private String city;
    private String country;
    I want a mapping that associate on table to a class as following:
    table person:
    first_name
    last_name
    table Customer:
    first_name
    last_name
    city
    country
    Can you tell what can I do please !!!
    I have red the doc but I can find it out ...
    thank a lot for your help
    smail

    hello,
    Are you sure ?
    because in your docs it is mentioned that you support it.
    go to this link :
    http://docs.solarmetric.com/manual.html#ref_guide_mapping_classmapping
    it is explained there !
    thanks,
    smail

  • Action and Query-String in HTTP Adapter

    Hi,
    I am doing an IDOC -> SAP PI -> HTTP scenario
    HTTP application is external party (using Party).
    I have to build the URL Dynamically; so I use Dynamic Configuration in Message Mapping.
    The URL format (from help.sap.com) is http://<hostname:port>/<path>?<query-string>
    Hostname and port are know to me.
    From where will I get information about path and query-string , are they mandatory?
    help.sap.com has given details about sender HTTP: http://help.sap.com/saphelp_nwpi711/helpdata/en/44/8f54b8b01e3673e10000000a114a6b/content.htm but i want to know about receiver HTTP.
    Is there any example available?
    Thank you,
    Pankaj.

    > So I have to ask the External Parties to send the message (to SAP PI) to the URL (http://hostname:port/<action>?<query-string>)?
    When you replace the varaibles, yes.
    > Any idea about my original question (about action and query-string in receiver channel's URL) or should I use a RFC destination there (now it will be Type G I suppose)
    Just put the URL of the receiver.
    > There is SSL configuration also between External Parties and SAP PI (if this information is required).
    In that case, you put a URL with https://..

  • Horizontal mapping with inverse-owner doesn't work

    Hi,
    We encountered a problem of using inverse-owner with horizontal mapping.
    Here is the example.
    public abstract class A {
    //collection of class T
    private Set ts = new HashSet()
    public class B extends A {
    private String name;
    public class T {
    private A owner;
    private String text;
    we use metadata factory. package.jdo looks like this.
    <class name="T"/>
    <class name="A">
    <extension vendor-name="kodo" key="jdbc-class-map" value="horizontal"/>
    <field name="ts">
    <collection element-type="T"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="owner"/>
    </field>
    </class>
    <class name="B" persistence-capable-superclass="A">
    </class>
    mappingtool gives java.lang.ClassCastException
    at kodo.jdbc.meta.OneToManyFieldMapping.map(OneToManyFieldMapping.java:126)

    Fred-
    This is a bug in the automatic generation of mappings. See:
    http://bugzilla.solarmetric.com/show_bug.cgi?id=1096
    Note this this bug only seems to apply to the automatic generation of
    mappings: if you manually compose the .mapping file, then you can
    express the one-many mapping (provided you can cast it down to a single
    concrete type with the "type" extension).
    See the bug report page for an example mapping file solution.
    In article <[email protected]>, Fred Chen wrote:
    Hi,
    When using horizontal mappings, you cannot have an inverse type relation
    to a horizontally mapped class (there is no table to hold the
    inverse!)But that is precisely why we want to use the inverse mapping (to AVOID the
    unecessary middle table). Can you explain in a bit more detail why this is
    not supported?
    Thanks,
    Fred
    "Stephen Kim" <[email protected]> wrote in message
    news:[email protected]...
    When using horizontal mappings, you cannot have an inverse type relation
    to a horizontally mapped class (there is no table to hold the
    inverse!). However, if you have a concrete type that it is always
    mapped to, you can indicate that using the type and element-type
    extensions to override the Java declarations to the concrete mapped type.
    Fred Chen wrote:
    Hi,
    We encountered a problem of using inverse-owner with horizontal mapping.
    Here is the example.
    public abstract class A {
    //collection of class T
    private Set ts = new HashSet()
    public class B extends A {
    private String name;
    public class T {
    private A owner;
    private String text;
    we use metadata factory. package.jdo looks like this.
    <class name="T"/>
    <class name="A">
    <extension vendor-name="kodo" key="jdbc-class-map" value="horizontal"/>
    <field name="ts">
    <collection element-type="T"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="owner"/>
    </field>
    </class>
    <class name="B" persistence-capable-superclass="A">
    </class>
    mappingtool gives java.lang.ClassCastException
    at
    kodo.jdbc.meta.OneToManyFieldMapping.map(OneToManyFieldMapping.java:126)
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Value Mapping and Dynamic Value Mapping

    Hi Experts,
    Could you please give a example for Value Mapping and Dynamic Value Mapping?
    Regards
    Sara

    Sara,
    I am assuming that you are going to use the Receiver JDBC adapter to select the data from the database.
    In this case, take a look at this blog of mine to understand how te dataypes should be created for the request and response JDBC Select Query.
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    The only difference would be that in the mapping when you create the Request Message for the JDBC adapter, the columns you create would be determined from the Source,
    i.e, if value = 1 , only the required Columns should be mapped as Blank constants,
    likewise for the other requirement.
    the columns you do not want to select you should not create them in theoutput of your request mapping.
    Regards
    Bhavesh

Maybe you are looking for