JDBC AND Spatial Object

How can I select and view a spatial object with JDBC Queries ?
I use the Object relationnal and NOT the relationnal model!
Thanks.

Macleod,
I think what you really want to use is OO4O:
http://otn.oracle.com/tech/windows/ole/index.html
I've used it with VB to build applications dealing with LOBS, and it is much easier to use than ADO for that purpose.

Similar Messages

  • Forms 9i and spatial objects

    Hi there,
    I was wondering if there is some smart thinkers out there that could solve or at least get a work around for a bug we have discovered in Forms 9i
    When a reference is made to a table that contains a object column (ie spatial, blob etc) through pl/sql code, the following error occurs. eg when you select count(*) from a table with a spatial (SDO_GEOM) column.
    Error 999 : implementation restriction (may be temporary) ADT or schema level collection not supported at client side with non-OCI mode.
    This is due to a tighting in forms 9i when referencing such tables where 6i only brought up the error is you directly reference the object column.
    Oracle has suggested a work around, or really a recoding of our forms (over 1000 in production) such that is to
    move the code to the server and just call it from forms. If you need to pass the objects then the client will need to break them down and pass the scalar attributes, as mentioned in bug 2502240.
    We are at a loss as to the solution as this one is unworkable, if anyone can make suggestions that would be great.
    Regards,
    Stuart Ross

    Is there any suggested solution on this issue.
    I'm trying to call a function which returns a VARRAY in Forms.
    But getting the above mentioned error.
    Thanks
    Bhavani

  • How to make use of XMLDB to process large XML and create spatial objects

    For someone new to XMLDB I find it hard to make sense of the enormous amount of information (and easy to get lost in it). So I come here to ask for directions.
    I have to build a procedure that fills a table of spatial objects based on XML input. Basically the XML contains a large amount of elements that describe the geometry type and contain the geometries coordinates. The XML can get quite large (200-300Mb).
    Somehow I have to process each element and create an sdo_geometry object.
    Now let me ask a very broad question: What would be a good way to handle this?

    I have the same question. Any news on this?
    Wijnand

  • 10.2.0.4, Spatial and invalid objects

    We don't use spatial. We have no plans to use spatial. We do use Intermedia, badly.
    When I upgraded a database from 10.2.0.3 to 10.2.0.4, everything went OK, except that one object in the MDSYS schema (I can't remember its name, but it was something like SDO_GEOMETRY) was rendered 'invalid' in dba_objects afterwards.
    I tried to manually re-compile it. It produced errors like 'table doesn't exist'. And I got to thinking that this was a Spatial object that was invalid because none of the other Spatial components was installed. I needed the invalid status to go away because my boss has a query that spots invalid objects and hassles me if any exist, and my attempts to say 'this one doesn't matter' weren't working.
    So I used dbca to add Spatial to the database. (Added a tick to the spatial selector on the database options page). The addition went well, and at the end of it... zero invalid objects.
    Problem solved, sort of. Now I have a new problem: when I ran dbca again to UNinstall Spatial, the tick against the Spatial option is greyed out and it cannot be de-selected and hence removed from my database.
    And so my questions. How do you remove the Spatial stuff? Will removing it break Intermedia? Is there a better way to fix the 'invalid MDSYS object' problem caused by the 10.2.0.4 upgrade in the first place, because I have 8 other database to upgrade in the coming days? And, if the simplest thing to do is to just leave all the Spatial objects in the database, will we be in breach of our license, because we certainly haven't paid to use this feature, but we equally certainly have no use for it?

    I would guess that most questions asked here could have been resolved by 'searching on Metalink first'. According to your standards and rules, then, that makes this place mostly redundant. Perhaps we should just shut the place down?
    No, I'll tell you what: if you find your time being wasted, perhaps you could just not bother replying instead of pronouncing on high how those so much less exalted than yourself should behave and do things. You could have provided a metalink document number without the accompanying attitude, and then you would have my thanks and appreciation. But, for being a pompous a-s-s, you get neither.
    Here's a clue. Classic Metalink. Search for '10.2.0.4 spatial errors after upgrade', All Sources. Your precious document appears only 16th in the resulting list. Yeah, I could wade through 15 irrelevant documents before stumbling over the correct one, but I figure upgrading to 10.2.0.4 can't be that rare; somebody will have encountered the problem before; quickest way to a solution is therefore probably to post here. Not, I would have thought, an entirely unreasonable train of thought, though obviously it is in your particular corner of the universe.
    Besides which, whilst that document tells me how to fix the invalid objects without installing Spatial, which will certainly prove useful for all my other database upgrades, it doesn't tell me (and neither did you) how you uninstall Spatial after having installed it with dbca. That's not asking you to fill in the gaps, by the way: I wouldn't want to waste any more of your precious time.
    I'm just pointing out that your "answer", as well as being pompous and arrogant, also proves itself to be deficient.

  • Issues in persisting dynamic entity and view objects using MDS

    Hi All,
    I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml.
    I'm facing following two errors while trying to run the app module:
    1. MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/model/DynamicEntityGenModuleOperations.xml"
    2. oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /sessiondef/dynamic/DynamicDeptEntityDef.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
    I've gone through the following links which talks about the cause of the issue, but still can't figure out the issue in the code or the config file. Please help if, someone has faced a similar issue.
    [http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG |http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG ]
    [http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm|http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm]
    Attached is the code for dynamic entity/view object generation and corresponding adf-config.xml used.
    ///////////App Module Implementation Class/////////////////////////
    public class DynamicEntityGenModuleImpl extends ApplicationModuleImpl implements DynamicEntityGenModule {
    private static final String DYNAMIC_DETP_VO_INSTANCE = "DynamicDeptVO";
    * This is the default constructor (do not remove).
    public DynamicEntityGenModuleImpl() {
    public ViewObjectImpl getDepartmentsView1() {
    return (ViewObjectImpl) findViewObject("DynamicDeptVO");
    public void buildDynamicDeptComp() {
    ViewObject internalDynamicVO = findViewObject(DYNAMIC_DETP_VO_INSTANCE);
    if (internalDynamicVO != null) {
    System.out.println("OK VO exists, return Defn- " + internalDynamicVO.getDefFullName());
    return;
    EntityDefImpl deptEntDef = buildDeptEntitySessionDef();
    ViewDefImpl viewDef = buildDeptViewSessionDef(deptEntDef);
    addViewToPdefApplicationModule(viewDef);
    private EntityDefImpl buildDeptEntitySessionDef() {
    try {
    EntityDefImpl entDef = new EntityDefImpl(oracle.jbo.server.EntityDefImpl.DEF_SCOPE_SESSION, "DynamicDeptEntityDef");
    entDef.setFullName(entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setName(entDef.getName());
    System.out.println("Application Module Path name: " + getDefFullName());
    System.out.println("EntDef :" + entDef.getFileName() + " : " + entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setAliasName(entDef.getName());
    entDef.setSource("DEPT");
    entDef.setSourceType("table");
    entDef.addAttribute("ID", "ID", Integer.class, true, false, true);
    entDef.addAttribute("Name", "NAME", String.class, false, false, true);
    entDef.addAttribute("Location", "LOCATION", Integer.class, false, false, true);
    entDef.resolveDefObject();
    entDef.registerSessionDefObject();
    entDef.writeXMLContents();
    entDef.saveXMLContents();
    return entDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private ViewDefImpl buildDeptViewSessionDef(EntityDefImpl entityDef) {
    try {
    ViewDefImpl viewDef = new oracle.jbo.server.ViewDefImpl(oracle.jbo.server.ViewDefImpl.DEF_SCOPE_SESSION, "DynamicDeptViewDef");
    viewDef.setFullName(viewDef.getBasePackage() + ".dynamic." + viewDef.getName());
    System.out.println("ViewDef :" + viewDef.getFileName());
    viewDef.setUseGlueCode(false);
    viewDef.setIterMode(RowIterator.ITER_MODE_LAST_PAGE_FULL);
    viewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    viewDef.setSelectClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.addEntityUsage("DynamicDeptUsage", entityDef.getFullName(), false, false);
    viewDef.addAllEntityAttributes("DynamicDeptUsage");
    viewDef.resolveDefObject();
    viewDef.registerSessionDefObject();
    viewDef.writeXMLContents();
    viewDef.saveXMLContents();
    return viewDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private void addViewToPdefApplicationModule(ViewDefImpl viewDef) {
    oracle.jbo.server.PDefApplicationModule pDefAM = oracle.jbo.server.PDefApplicationModule.findDefObject(getDefFullName());
    if (pDefAM == null) {
    pDefAM = new oracle.jbo.server.PDefApplicationModule();
    pDefAM.setFullName(getDefFullName());
    pDefAM.setEditable(true);
    pDefAM.createViewObject(DYNAMIC_DETP_VO_INSTANCE, viewDef.getFullName());
    pDefAM.applyPersonalization(this);
    pDefAM.writeXMLContents();
    pDefAM.saveXMLContents();
    ////////adf-config.xml//////////////////////
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
    xmlns:sec="http://xmlns.oracle.com/adf/security/config">
    <adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
    <defaults useBindVarsForViewCriteriaLiterals="true"/>
    <startup>
    <amconfig-overrides>
    <config:Database jbo.locking.mode="optimistic"/>
    </amconfig-overrides>
    </startup>
    </adf-adfm-config>
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="TestDynamicEC-8827"/>
    </adf:adf-properties-child>
    <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
    </sec:adf-security-child>
    <persistence-config>
    <metadata-namespaces>
    <namespace metadata-store-usage="mdsRepos" path="/sessiondef/"/>
    <namespace path="/model/" metadata-store-usage="mdsRepos"/>
    </metadata-namespaces>
    <metadata-store-usages>
    <metadata-store-usage default-cust-store="true" deploy-target="true" id="mdsRepos">
    <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
    <property name="metadata-path" value="/tmp"/>
    <!-- <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
    <property name="jndi-datasource" value="jdbc/TestDynamicEC"/>
    <property name="repository-name" value="TestDynamicEC"/>
    <property name="jdbc-userid" value="adfmay28"/>
    <property name="jdbc-password" value="adfmay28"/>
    <property name="jdbc-url" value="jdbc:oracle:thin:@localhost:1521:XE"/>-->
    </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    </persistence-config>
    </adf-config>
    //////////////////////////////////////////////////////////////////////////////////////////////////////////

    Hi Frank,
    I m trying to save entity and view object xml by calling writeXMLContents() and saveXMLContents() so that these objects can be retrieved using the xmls later on.
    These methods internally use MDS configuration in adf-config.xml, which is creating the issue.
    Please share your thoughts on resolving this or if, there is any other way of creating dynamic entity/view objects for db tables created at runtime.
    Nik

  • ORA-13050:unable to construct spatial object in using SDO_INTERSECTION

    Hi Specialists,
    I am using Oracle Spatial and getting the ORA-13050 error when using the SDO_Intersection procedure. Below are the details of this.
    Objective: To find the addresses whose boundary lie within a user defined polygon.
    Input: List of coordinates for the user defined poygon.
    Query I am using: SELECT SDO_GEOM.SDO_INTERSECTION (add.boundary, SDO_GEOMETRY(2003,8311,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY( 149.986507,-36.727242,149.985898,-36.726819,149.986756,-36.726512,149.987288,-36.726803,149.986507,-36.727242)), 0.000001)
    FROM address add
    WHERE add.id = '254378298'
    Error Received:
    ORA-13050: unable to construct spatial object
    ORA-06512: at "MDSYS.SDO_3GL", line 715
    ORA-06512: at "MDSYS.SDO_3GL", line 745
    ORA-06512: at "MDSYS.SDO_GEOM", line 3016
    ORA-06512: at "MDSYS.SDO_GEOM", line 3065
    Please can any one help me in this issue very urgent.
    Thanks,
    Ashish

    Hi All,
    The problem has been resolved by transforming the user defined polygon coordinates into the database specific coordinate system.
    Thanks

  • JAVA Calling Oracle Function and Returning OBJECT

    HI,
    I am working as a developer in java/j2ee project.
    I am facing one issue:
    I need to call Oracle function from java code. Oracle User define function is residing in oracle package and returning Object which contains data.
    Can you please help me
    With Best Regards

    golduniya wrote:
    I need to call Oracle function from java code. Oracle User define function is residing in oracle package and returning Object which contains data.
    Can you please help meIt requires a great deal of Oracle jdbc driver specific code.
    [http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/oraint.htm#1012664]

  • Spatial Objects in Designer

    I have discovered what many before me already know, that Designer (including 8i) does not support Spatial objects. This seems to be related to it not supporting VARRAYS with more than 6 characters worth of precision. Does anybody know when this might be corrected? Will we be waiting weeks or months?

    Indu,
    The short answer to your question is no, you cannot sort objects, and this is intentional on the part of the creator of the Designer tool.
    Working in Designer is a science and an art.  The science portion is understanding the underlying model of the database and bringing in all applicable tables and connections properly.  The art portion is in the presentation to the users as you bring a human touch (the semantic layer) from the database to the user.  Most implementations for presentation of objects is to organize the objects by context (class, sub-class, etc), and to order the objects within its context by "most frequent" or "compelling".  In order to achieve all of this, the person working within Designer must understand the data and the business in order to best serve the user.
    I know that this is a long-winded explanation to a simple question, however, sometimes it is best to understand the philosophy behind a software tool's limitation in order to understand how to best use it.  There are some excellent works published independently from Business Objects that address the concepts of semantic layer presentation and overall management of the Business Objects software suite, one such title that comes to mind is Cindi Howson's "BusinessObjects The Complete Reference" (available from fine booksellers).
    Thanks,
    John

  • ORA-13050: unable to construct spatial object

    Hi
    I'm executing the following query
    select mdsys.sdo_geom.sdo_intersection (geoloc, :1, 20) geoloc, mdsys.sdo_geom.sdo_distance (mdsys.sdo_geom.sdo_intersection (geoloc, :2, 20), :3, 20) distance
    from streets
    where mdsys.sdo_relate (geoloc, :5, 'mask=touch querytype=window') = 'TRUE'
    order by distance
    In some locations the query works perfectly and in some other locations it throws
    ORA-13050: unable to construct spatial object
    Regards,
    Néstor Boscán

    I found the problem
    It seems I have invalid polygons in my data.
    Regards,
    Néstor Boscán

  • ORA-13050 unable to construct spatial object - Error

    Hi friends!,
    I to realize the follow query:
    SELECT A.MI_PRINX, B.DESCRIP
    FROM PEVEDISC A, PEVEGEO B
    WHERE SDO_GEOM.RELATE(A.GEOLOC,'ANYINTERACT',B.GEOLOC,0.005) = 'TRUE'
    AND SDO_GEOM.RELATE(A.GEOLOC,'TOUCH',B.GEOLOC,0.005) = 'FALSE'
    AND ROWNUM <= 10
    and result error "ORA-13050 unable to construct spatial object". Please help me, i don't know what to do!. thanks

    Hi,
    Have you validated your data? Try validating using sdo_geom.validate_geometry_with_context or sdo_geom.validate_layer_with_context.
    I would also like to offer a suggestion on how to write this query. If there are a significant number of geometries in either or both of these tables, this query can take a long time to run.
    If you create spatial indexes on these tables, then the following might be better:
    SELECT /*+ ordered */ A.MI_PRINX, B.DESCRIP
    FROM PEVEGEO B, PEVEDISC A
    WHERE SDO_RELATE(A.GEOLOC,B.GEOLOC,
    'querytype=window mask=inside+coveredby') = 'TRUE'
    AND ROWNUM <= 10;

  • Inconsistent java and sql object types

    Hi,
    I have run into error "Inconsistent java and sql object types"
    while mapping a java class to a sql object type. The java class
    is just a duplicate of sql data structure and I pretty much
    follow the JDBC Developer's GUide's examples (20-43 to 20-45)
    to create the mapping java class.
    Any one runs into simliar problem or any clues?
    Thanks,
    Ed
    Exception in thread "main" java.sql.SQLException: Inconsistent java and sql object types: InstantiationException:
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.sql.STRUCT.toClass(STRUCT.java:433)
    at oracle.sql.STRUCT.toJdbc(STRUCT.java:366)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle80rec
    (OracleTypeUPT.java:236)
    at
    oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec_elems
    (OracleTypeCOLLECTION.java:553)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec
    (OracleTypeCOLLECTION.java:383)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80
    (OracleTypeCOLLECTION.java:329)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize
    (OracleTypeCOLLECTION.java:218)
    at oracle.sql.ArrayDescriptor.toJavaArray
    (ArrayDescriptor.java:501)
    at oracle.sql.ARRAY.getArray(ARRAY.java:197)

    The safest way would be to use JPublisher to generate the type classes. In your application, you can just use the generated code to manipulate the object.

  • ORA-22813 error when deleting spatial objects in LIVE

    Hi,
    We are getting an ORA-22813 error when attempting to delete a spatial object from a version-enabled table in workspace LIVE. The spatial object to be removed has a SDO type of multipolygon. The geometry information consists of 4 rings with a combined ordinate count of 4120. The statement used to delete the row is:
    delete from tableA where tableA.id in (select tableA.id from tableA where tableA.id = 3);
    The error occurs only on a 10g R1 Oracle instance (10.1.0.5.0) with Workspace Manager version 10.1.0.7.1. The delete operation succeeds without problems on a 10g R2 (10.2.0.2.0) instance with Workspace Manager version 10.2.0.3.1. The statement is also executed successfully on the 10g R1 instance if the table is not version-enabled.
    Any help on this would be appreciated.
    Thanks

    Hi,
    I would recommend filing a TAR in this one. The only ora-22813 error involving workspace manager and geometry columns that I know about involves queries that need to sort data for which the size of the geometry column was >30k. Does the execution plan for the delete statement involve any kind of sort? However, this is an old 9.2 bug, that I believe was fixed for all 10.1 and newer releases.
    Does the same error happen if you do not use the subquery?
    Regards,
    Ben

  • How to combine Session Facade and Transfer object?

    Hello All!
    I'm working on an enterprise application. Presentation layer is a stand alone client, business logic is build on the Glassfish v2.1 and MySQL is used as a database. The client is connection to the GlassFishj server remotely using EJBs.
    I have problems with business logic architecture.
    Here is the brief description of backend application architecture design:
    1. Session Facade pattern is used to simplify the client and application server interface and to provide application layers between backend (http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html).
    2.Transfer Object pattern to define update transfer objects strategy in order to decrease network overhead during client and application server interactions and to provide version control for objects. Transfer objects are designed as simple java business serializable objects. (http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html)
    3. Originally the backend application consisted of three modules: users, storage and orders, but at the end I have decided to divide my application into the following parts - assortments, map, menu, orders, transactions, users.
    4. All MySQL database transactions are via JDBC using procedures. No use of entity beans.
    Questions:
    1. I have some doubts about using Session Facade and Transfer object patterns at the same time. At first I'd mike to cite the definitions of the patters from the SUN official web site.
    * Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.
    * Use a Transfer Object to encapsulate the business data. A single method call is used to send and retrieve the Transfer Object. When the client requests the enterprise bean for the business data, the enterprise bean can construct the Transfer Object, populate it with its attribute values, and pass it by value to the client.
    * So, if I use Transfer Object along with Session Facade, it makes some difficulties with object version control, because I 2 or
    3 transfer objects controls with the 1 bean class. The best option for Transfer object Pattern is that each transfer object should have its own bean class to provide ability of object's version control. In the case it can bring the network overhead because of frequent remote calls caused by the large number of the bean classes.
    * So, should I use the both patterns? If yes, how to manage the interaction the patterns. If no, which one to use.
    2. E.g. I have a huge list of the Order objects and each Order object consists of other complicated objects. So, would I have trouble to transfer that list over network? If yes, how to manage it.
    Thank you!
    Astghik

    Astghik wrote:
    Hello All!
    I'm working on an enterprise application. Presentation layer is a stand alone client, business logic is build on the Glassfish v2.1 and MySQL is used as a database. The client is connection to the GlassFishj server remotely using EJBs.
    I have problems with business logic architecture.
    Here is the brief description of backend application architecture design:
    1. Session Facade pattern is used to simplify the client and application server interface and to provide application layers between backend (http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html).
    I would simply recommend establishing a service tier. Your services should be stateless. You can go the extra mile and have a session facade, but in the majority of cases, coding to an interface for your service accomplishes the same goals.
    2.Transfer Object pattern to define update transfer objects strategy in order to decrease network overhead during client and application server interactions and to provide version control for objects. Transfer objects are designed as simple java business serializable objects. (http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html)
    The idea of the transfer object is very similar to the Command pattern. I think if you investigate that pattern, it will be more obvious. The transfer object reduces network latency by consolidating all the parameters into an object, ideally, this also consolidates multiple method calls. If you combine a transfer object (or command object) with a service tier, you get the best of both worlds. The service can delegate calls to helper objects (or other services or components) using the data in the transfer / command object.
    3. Originally the backend application consisted of three modules: users, storage and orders, but at the end I have decided to divide my application into the following parts - assortments, map, menu, orders, transactions, users.
    The is your domain. It will vary from application to application. The principles above are more general (e.g., patterns and architectural tiers) and should apply to most domains. However, your actual use case may require something different.
    4. All MySQL database transactions are via JDBC using procedures. No use of entity beans.
    Consider using something like iBatis or Spring's JDBC templating to make your life easier with JDBC.
    Questions:
    1. I have some doubts about using Session Facade and Transfer object patterns at the same time. At first I'd mike to cite the definitions of the patters from the SUN official web site.
    * Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.
    * Use a Transfer Object to encapsulate the business data. A single method call is used to send and retrieve the Transfer Object. When the client requests the enterprise bean for the business data, the enterprise bean can construct the Transfer Object, populate it with its attribute values, and pass it by value to the client.
    * So, if I use Transfer Object along with Session Facade, it makes some difficulties with object version control, because I 2 or
    3 transfer objects controls with the 1 bean class. The best option for Transfer object Pattern is that each transfer object should have its own bean class to provide ability of object's version control. In the case it can bring the network overhead because of frequent remote calls caused by the large number of the bean classes.
    * So, should I use the both patterns? If yes, how to manage the interaction the patterns. If no, which one to use.
    Versioning is a separate issue. Generally, the more coarsely grained your transfer / command object is, the more changes are likely to impact dependent objects.
    Your command or transfer object does not have to be a vanilla JavaBean, where you are basically creating a bean that has data from other objects. You can simply use your command / transfer object to encapsulate already existing domain objects. I see no need to map to a JavaBean with what you have described.
    Generally, a method signature should be understandable. This means that many times it is better to pass the method, say, two coarsely grained objects than a signature with a dozen primitives. There are no hard and fast rules here. If you find a method signature getting large, consider a transfer / command object. If you want one service to delegate calls to a number of other services, you can also create a transfer / command object to furnish the controlling service with the data it needs to invoke the dependent services.
    2. E.g. I have a huge list of the Order objects and each Order object consists of other complicated objects. So, would I have trouble to transfer that list over network? If yes, how to manage it.
    This is a large, open-ended question. If you are going to display it to a user on a screen, I do not see how you avoid a network transfer with the data. The general answer is to not pass the data itself but rather a token (such as a primary key, or a primary key and a start and stop range such as you see on a Google search result). You do want to limit the data over the network, but this comes at a cost. Usually, the database will receive additional load. Once that becomes unacceptable, you might start putting things into session. Then you worry about memory concerns, etc. There is no silver bullet to the problem. It depends on what issues you are trying to address and what trade-offs are acceptable in your environment.
    Thank you!
    AstghikBest of luck.
    - Saish

  • Performanceproblem with WL6.1 JDBC and Oracle

    Hi!
    I have a big performance-problem using wl6.1, jdbc and oracle.
    My Server is sending a Vector with NodeBeans via JDBC to a OracleDB. The answer
    comes immediately with the timeout.
    Why is the EJB waiting for the timeout?
    Is it a problem of configuration?
    Thanks
    Thomas

    Hi Sree,
    here I send You the class with the main problem. The call queryDataSet.refresh();
    is the timeconsuming part.
    We are using WL6.1sp2, Oracle 8.1.7 with classes12. In our environment we can
    not use connectionpools.
    It comes back with a timeout AND the data. Calling it again immediately it takes
    2/3 of the time the timeout is set.
    Do You have a fine solution?
    Thanks
    Thomas
    package ppif.db;
    import java.rmi.*;
    import ppif.bo.*;
    import java.util.*;
    import com.borland.dx.dataset.*;
    import com.borland.dx.sql.dataset.*;
    import java.math.*;
    public class connector {
         private ppif.mapping.NodeDescriptions nodeDescriptions;
         public connector(ppif.mapping.NodeDescriptions nodeDescriptions) {
              this.nodeDescriptions = nodeDescriptions;
         public connector() {
              this.nodeDescriptions = nodeDescriptions;
         public Vector fetchNodes(ppif.bo.Node filterNode) throws RemoteException {
              String childClassName = null;
              Vector nodeVector = new Vector();
              Node node = null;
              if (nodeDescriptions == null) throw new RemoteException("nodeDescriptions ==
    null");
              // childClassName zu gegebenen filterNode ermitteln
              if (filterNode.getClassName().equals("DefaultRoot")) childClassName = "ST";
              if (filterNode.getClassName().equals("PrismaProjectsRoot")) childClassName =
    "PrismaProjects";
              if (childClassName == null) throw new RemoteException("Zum übergebenen filterNode
    wurde kein chlidClassName gefunden.");
              if (nodeDescriptions.getNodeDescription(childClassName) == null) throw new RemoteException("Für
    die ChildClass "+childClassName+" ist kein Mapping definiert.");
              // Vector mit Child-Knoten erzeugen durch DB-Zugriff
              ppif.mapping.NodeDescription nodeDescription = nodeDescriptions.getNodeDescription(childClassName);
    Database database = new Database();
    ParameterRow parameterRow = null;
    Column column = null;
    QueryDataSet queryDataSet = new QueryDataSet();
    // DB-Connect generieren
    database.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor(nodeDescription.dbUrl,
    nodeDescription.dbUser, nodeDescription.dbPassword, false, "oracle.jdbc.driver.OracleDriver"));
    int queryCount = 0;
    // Schleife über alle queries der childKlasse, gemäss Mapping
    for (Iterator it = nodeDescription.mappingQueries.iterator(); it.hasNext();
                   ppif.mapping.MappingQuery mappingQuery = (ppif.mapping.MappingQuery)it.next();
                   String queryString = mappingQuery.getQueryString();
                   parameterRow = mappingQuery.getParameterRow();
                   // ParameterRow mit Input-Werten füllen
                   for (int i=0; i<parameterRow.getColumnCount(); i++) {
                        String columnName = parameterRow.getColumn(i).getColumnName();
                        String filterAttributeName = columnName;
                        Object filterAttributeValue = filterNode.getAttribute(filterAttributeName).getVal1();
                        switch (parameterRow.getColumn(i).getDataType()) {
                             case com.borland.dx.dataset.Variant.BIGDECIMAL:
                                  BigDecimal val = (BigDecimal)filterAttributeValue;
                                  parameterRow.setBigDecimal(i, val);
                                  break;
                             case com.borland.dx.dataset.Variant.STRING:
                                  parameterRow.setString(i, (String)filterAttributeValue);
                                  break;
                             default:
                                  throw new RemoteException("Unbekannter Datentyp");
                   // Query generieren
                   queryDataSet.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database,
    queryString, parameterRow, false, Load.ALL));
                   // DB-Verbindung öffnen
                   queryDataSet.open();
                   // Rolle setzen
                   if (nodeDescription.dbRole != null) {
                        java.sql.Statement setRole;
                        String roleName = nodeDescription.dbRole;
                        String rolePwd = nodeDescription.dbRolePassword;
                        try {
                             java.sql.Connection jdbcConnection = database.getJdbcConnection();
                             setRole = jdbcConnection.createStatement();
                             setRole.execute("SET ROLE " + roleName + " IDENTIFIED BY " + rolePwd);
                        } catch (java.sql.SQLException exception) {
                             throw new RemoteException(exception.getMessage());
                        } catch (Exception exception) {
                             throw new RemoteException(exception.getMessage());
                   // Query ausführen
                   queryDataSet.refresh();
                   // Datensätze in Node-Objekte umwandeln
                   int columnCount = queryDataSet.getColumnCount();
                   String columnArray[];
                   columnArray = queryDataSet.getColumnNames(columnCount);
                   for(queryDataSet.first(); queryDataSet.inBounds(); queryDataSet.next()) {
                        Node rNode = nodeDescriptions.createNodeInstance(childClassName);
                        // Abfrageergebnissen in eine Attributliste übertragen
                        for (int i=0; i<columnCount; i++) {
                        nodeVector.add(rNode);
                   queryCount++;
              return nodeVector;
         public ppif.mapping.NodeDescriptions getNodeDescriptions() {
              return nodeDescriptions;
         public void setNodeDescriptions(ppif.mapping.NodeDescriptions nodeDescriptions)
              this.nodeDescriptions = nodeDescriptions;
    "Sree Bodapati" <[email protected]> wrote:
    hi Thomas,
    please post more detail on what your code is doing. if possible a code
    snippet/error messages/thread dump
    sree
    "Thomas Eberhard" <[email protected]> wrote in message
    news:[email protected]...
    Hi!
    I have a big performance-problem using wl6.1, jdbc and oracle.
    My Server is sending a Vector with NodeBeans via JDBC to a OracleDB.
    The
    answer
    comes immediately with the timeout.
    Why is the EJB waiting for the timeout?
    Is it a problem of configuration?
    Thanks
    Thomas

  • Oracle Spatial Object

    I have more than 2 geographical points In USA saved in oracle DB using geometry object...
    are there any function in Oracle Spatial Object that gives me the shortest route to go through all theses geographical points

    You would need to create a network with all of your point geometries as nodes and lines as links.  See...
    Oracle® Spatial Topology and Network Data Models Developer's Guide
    11g Release 2 (11.2) Part II
    Once you do that you can use it to solve your problem (traveling salesman).

Maybe you are looking for