Object serialization to database

Hi, how can objects be made persistent to database without using JDBC SQL calls ? In other words, we would like to avoid SQL calls "UPDATE...", "INSERT INTO..." entirely . They are error prone . Can it be done without EJB Entity Beans ? Or EJBs are absolutelly mandatory in this case ?
We are using IBM Visual Age 4 and WebSphere 4.
Thanks

If you want to persist any data to a database, you must use SQL calls.
If your SQL calls are not reliable, you have the wrong developer writing the SQL.

Similar Messages

  • Serialize object to MSQL database

    Hi
    Is it possible to serialize object to MSQL database instaed of file/Store?
    Please guide me...
    Thank you very much in advance
    PSL

    Somebody please throw some idea...Thank you very much

  • Object Serialization(Materialization and Dematerialization)

    I've encountered some issues with mapping my objects to an RDBMS and am hoping for some advice.
    I've tried various O/R mapping frameworks like Castor(too complex and too slow for my liking), JRF(nice but very repetitive and difficult to extend) and then some, but have yet to find one which I'm comfortable with building an application on.
    Instead, I've chosen to do it the low-tech way, with each domain class, say Book for instance, having a Broker class which knows how to communicate with the chosen form of persistence. So, since I chose an RDBMS, Book class has a BookRelationalBroker class which knows how to materialize and dematerialize Book objects to and from a RDBMS. If so required, I can plug in a BookXMLBroker which knows how to serialize the object in the form of an xml data file.
    I've also implemented a primitive object caching system which (when enabled), caches objects requested so we only have to materialize it from the db once.
    Here are 2 issues I have with my system:
    It is amazingly tedious (not to mention inefficient) to recreate the entire object from the database. This is even more so because I've implemented the Event Notification pattern, such that when say a book is deleted, the members who have reserved it are notified. The whole point of the Event Notification mechanism is so that the object being watched does not need to know of the objects which need to be notified on a state change. However, I've found it necessary to re-attach all the listeners on an object when it is materialized from the DB, defeating the purpose of the pattern.
    Complex object relationships are mapped poorly and recursive materialization leads to slow response times. If a Group object has a Vector of Members and other Groups, then whenever a Group object is materialized, all its constituent Members and Group objects also need to be materialized. (I understand O/R frameworks solve this through lazy instantiation)
    I studied the Jive2 architecture and found that they approached this problem by accessing the DB directly for any complex object relationships. In other words, the Group object does not actually contain a Vector of Members and Groups. Instead, it has a method called say getMembers() which proceeds to retrieve the necessary data from the DB and then materialize these objects.
    I'm not too excited about this approach for 2 reasons:
    How object-oriented is this approach? Seems more like database-oriented programming to me.
    Every call to retrieve Members necessitates a call to the DB. The data isn't cached with the Group object because the Group object does not actually contain the necessary reference to the Members and Groups.
    Can anyone shed some light on this topic?

    How object-oriented is this approach? Seems more like database-oriented programming to me. There is a reason people still use Relational databases rather than OO DBs. First, is that the vast majority of data in the real world maps easily to a relational model, consequently there is no advantage to a OO model. Second, either because of this or simply because OO models are not computationally simple, OO databases tend to be slower than relational DBs.
    It sounds like you are trying to implement a OO DB model using a relational database. So you basically end up with two problems. The DB is not optimized for OO models, and you have to find a way to map it in the OO model itself. And this is slow and messy.
    To solve the slowness problem you could, just like EJB servers, cache the data in memory. Lot of work but if you want to do it then have fun.
    The second way is to give up. Realize that your data model is not inherently OO'd and just implement it efficiently as a relational model. Then provide an interface that loads it into the OO model. And where needed add pass through logic to allow the database itself to do things it is really good at - like queries.

  • How To Store dom4j.Document Object in MySQL Database?

    Hi Everyone, i am currently using dom4j to create an xml document object i wish to hold the object in a mysql database using jdbc, however the document object does not implement serializable, i am having difficulty in storing the document object as a BLOB object within the database, any suggestions?
    any help or advice would be greatly appreciated
    Thanks

    Convert the Document object to String and store the XML string in MySQL database.

  • How to store java objects in the database

    Hi,
    I am trying to store HttpSession state across Application Servers. Basically I am trying to build a sort of application cluster server on my own. I thought the best way to do this was to periodically store the HttpSession object from an application server in a database.
    I created a table in Oracle 8i with a blob column. I use a PreparedStatement.setObject() method to store the HttpSession object in the database. My problem is, I don't know how to get the object back from the database.
    Since ResultSet.getBlob returns the Blob locator, I need to read the BinaryInputStream to get all my data back. This tells me that getBlob basically works only for things like files, and cannot be used for Java objects.
    Is there any way around this? Your input would be much appreciated.
    Regards,
    Somaiah.

    Thanks for the quick reply vramakanth.
    Do I have to use a type map if I do this? Also does such a type map exist for the HttpSession class?
    Thanks,
    Somaiah.

  • How to check the owner of any Object in the database.

    How to check the owner of any Object in the database.
    Thanks
    Himanshu

    What about this ?
    SELECT owner,Object_name,object_type FROM all_objects
    OR
    SELECT owner,Object_name,object_type FROM dba_objects

  • Reg:-10901: Database error: [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error. Check your network documentation.. Contact your Business Objects administrator or database supplier for more information. (Error: WIS 10901)

    Hi Friends,
    When i schedule the report in infoview ,i am getting this error, could you please let me know how to solve this error.
    10901: Database error: [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error. Check your network documentation.. Contact your Business Objects administrator or database supplier for more information. (Error: WIS 10901)
    Thanks
    sreedhar

    Hi,
    I am able to refresh the report in Infoview and data is dispalying , but when i schedule the report in infoview i am getting that error.
    I am not clear on below one could you please elaborate on this
    You need to create ODBC for SQL server.Check your BO server is able to connect SQL Server.
    Thanks
    sreedhar

  • Recompile all invalid objects in live database

    Hi Expers,
    Just need a clarification on recompiling all invalid objects in production database when the systems is busy.
    i thought of recompile all the invalid objects using utlrp.sql script in my production database since some of few synonyms were invalid after application patch script been implemented last weekeend.
    we have identifed the invalid objects now, i thought to run the utlrp.sql, what will be the consequences.
    Regards,
    Salai

    Hi Hemanth,
    I'd reserve utlrp.sql for upgrades, downgrades and patchsets. I do agree 101% with above point, I a not denying on that.
    If you really have a large number of invalid objects, you might choose to compile a few "selected" objects every hour instead of running a single-shot "compile all invalid objects". Rare but a possible requirement.I came across such requirement during early days of career during pushing product enhancement to production and we would have get to know the things and number of objects which would go invalid as we use to carry out testing on test databases.
    I agree completely utlrp.sql is suggested and should opt for.
    - Pavan Kumar N

  • Should ADF Entity Object Map to Database Table or View?

    We are building a new 3-tier JClient/ADF application. We have mapped most entity objects directly to database tables. Now that we are preparing to deploy, our DBA is angry; he believes that all entity objects should be mapped to database views. The developers see this as a headache, UML can not forward/reverse changes, and now we have another layer of abstraction, which doesn't seem to serve a useful purpose. What is the best practice in a new 3-tier application?

    Hi,
    I'm still having problems but I found out why these tables are returning errors. The username I've been given by the DBA to connect to the database is CONSULTA, but this user is only for querying purposes, the actual objects reside on a differente schema, of course, which is PROD. So the line:
    "CONSULTA"."ESTADOS"@"PROD@AYADEV_LOCATION" "ESTADOS"
    raises an exception because the table ESTADOS is not located on that schema, but on PROD. If I query the table from SQL Plus with:
    SELECT *
    FROM [email protected]@AYADEV_LOCATION
    then there's no problem at all.
    Why is this? How do I instruct OWB to point to the correct schema or to avoind fully qualifying the table name?
    Please help me, I'm kind of confused here.
    Best Regards,
    --oswaldo.
    [osantos]

  • 2D objects Serialization problem

    Welcome!
    I'm making a net game using RMI and I have this problem.
    When I'm trying to join my client with the server an error occures:
    Error: error marshalling arguments; nested exception is:
         java.io.NotSerializableException: java.awt.geom.Ellipse2D$Double
    My client contains an Object extending a JPanel class. There are 2D object used to make the map, and that's why this error occures.
    It's a funny thing, cause I'm not sending a whole Object of my client, but only it's refference (using "this" in the join() method) so I dont know why does the 2D object need to be serialized and sent :|?
    Any way, my question is how to make 2D objects serializable!? I have jdk1.5.0_06 and as far as I remember they should be srializable in this version. Mabey I'm dooing something wrong!? Mabey it's nessesary to ad an appropreate code-line or import sth... i don't know
    please help me... I have little time to finish my project, and this thing is blocking my work.
    Big thanks to anybodey who will help.
    regards floW

    I'll tel u the whole story then, my problem is as follows:
    public class BounceThread{
       public static void main(String[] args)   {
          JFrame ramka = new BounceFrame();
             ramka.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             ramka.setVisible(true);
    class BounceFrame extends JFrame{
    public BounceFrame()
          setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
          setTitle("MiniGolf v 1.0");
          panel = new BallPanel(); // this contains maps made with 2D objects
          panel.setBackground(Color.green);
          panel.setVisible(panel.czy_widać_panel());
          add(panel, BorderLayout.CENTER);
    // I add a menu bar, that starts a net game:
    JMenuBar pasekMenu = new JMenuBar();
              setJMenuBar(pasekMenu);
              JMenu menuGra = new JMenu("Game");
           // and so on... and finaly I add an option:
              menuGame_Nowa.add(new
                        AbstractAction("Net game")
                             public void actionPerformed(ActionEvent event)
                                  net_game(panel);
    // here i write my net_game method:
    public void net_game(BallPanel aPanel)
         //here, i make an Client object, and connect him with my server
         client = new mgClient(panel);
         client.join();
         // I give panel as a paramete, cause I cant think of another way of leting my server to uce it's (panels) methods
         // If I join only a name of my client, then how can I change the panel in my BounceFrame from the Clients method
         // "shouted" by the server!? It has to be a field in the client's object.
         // Is there any other way out!?
    // Class BouceFrame holds the panel as a field:
    private mgClient client;
    private BallPanel panel;
    //and so on...
    }and that's the real problem I'm facing here. Is there any solution!? I think, that making a Client's field out of my panel is the only way ot. And that means I need those 2D objects serialized... :(
    Please help if u can.
    Regards floW

  • Viewing oracle8i objects in Jdeveloper database browser

    Hi,
    We've created objects in the backend (oracle8i).
    When we are trying to use JPublisher in JDeveoper we are not
    able to view the oracle objects in the database browser of the
    connection.
    The option 'object types' itself is not getting displayed.
    What could be the reason for this problem ?
    with regards
    jaya
    null

    Hi,
    Thanks for letting us know about the version which
    supports JPublisher.
    We are using JDeveloper version2.0. Is there any other way to
    create custom java classes?
    with regards
    jaya
    JDeveloper Team (guest) wrote:
    : Hello,
    : Which version of JDeveloper are you using?
    : : The option 'object types' itself is not getting
    : displayed.
    : This feature is supported in JDeveloper 3.0.
    : Regards,
    : Arun
    : jaya (guest) wrote:
    : : Hi,
    : : We've created objects in the backend (oracle8i).
    : : When we are trying to use JPublisher in JDeveoper we are not
    : : able to view the oracle objects in the database browser of
    the
    : : connection.
    : : The option 'object types' itself is not getting
    : displayed.
    : : What could be the reason for this problem ?
    : : with regards
    : : jaya
    null

  • Unable to create or update object after creating database

    I have installed Oracle 8.1.6 on a Solaris server (with documentation, cause I'm not expert of Unix).
    Next I have created a database and a user (with the doc too !!)
    I can make select on all the objects of this database (system tables for example). I have created one test table without any problem. Now I can't create any table or update the table on the server or on a client (the sql + froze). The select orders work. I tried to restard the server but the problem is the same.
    Thank you very much for your help

    There are no error ! (alert.log)
    The sql plus (on the client or on the server) froze when I launch the create or update command. The select command works.
    Thank you very much.

  • List of EJB object published in database

    how is it possible to list of EJB object published in database ?
    I'm using Oracle 8.1.7.
    Thanks

    Enterprise Manager --> DBA Pack --> Connect to JServer

  • Serialization vs Database?

    Hi,�
    I'm a J2EE developer with some "desktop type" questions. I recently started to branch out and develop some small scale desktop apps. Anyway, here is the question "In a Nutshell":
    What is the "best" way to persist data on a desktop/mobile application?
    For example, lets take a simple application that has only two objects, "User" and "GroceryList" where User contains a GroceryList.
    Being a "J2EE guy" I am familiar with multiple RDBMS', EJB3, etc etc, but wouldn't object serialization be better here? Why would it be beneficial to tie my app to the DB? Or maybe there is a third solution I am totally missing?
    Just looking for some feedback and wondering how this is normally done.
    Kevin

    Kevin_Cloutier wrote:
    Hi,
    I'm a J2EE developer with some "desktop type" questions. I recently started to branch out and develop some small scale desktop apps. Anyway, here is the question "In a Nutshell":
    What is the "best" way to persist data on a desktop/mobile application?"best" is always a scalable and relative term. How much data do you have?
    >
    For example, lets take a simple application that has only two objects, "User" and "GroceryList" where User contains a GroceryList.
    Being a "J2EE guy" I am familiar with multiple RDBMS', EJB3, etc etc, but wouldn't object serialization be better here? Why would it be beneficial to tie my app to the DB? Or maybe there is a third solution I am totally missing?IMO: it is fairly silly to tie an application into a DB for small amounts of data. When you approach a less manageable volume of data, then you enter the realm of needing a DB.
    Rule of thumb--unless your Grocery List is going to read like the contents of a Safeway Super Store, then why would you even consider it for say 100 items?

  • Groupwise Error [e811] Object not in database.

    A user is getting the following message when trying to open messages in a Client 7.0.3 folder: Groupwise Error [e811] Object not in database.
    Gwcheck shows no errors. The agent logs show no errors. This error just pops up in the client. Goes into endless loop of errors and client has to be shut down using crt-alt-del under task manager. It is in a shared folder and this user is the owner. Other users can open messages.

    Originally Posted by DParkes
    And you've been through TID 10080716, especially the creating a new
    document reference bit ?
    Cheers Dave
    Dave Parkes [NSCS]
    Occasionally resident at http://support-forums.novell.com/
    Dave
    Just read the TID. I'm probably dense, but not sure how it applies. All that is in the shared folder is a bunch of e-mail messages with pdf files attached. They are actually fax pdf files attached to e-mail from a fax machine. For years the folder had been shared this way, nada error message to be found until recently. Client is 7.0.3.

Maybe you are looking for