1 Reply Latest reply on Jun 30, 2002 1:48 PM by Dain Sundstrom

    Pre-Existing Tables and Entity Beans

    Jeff Andrews Newbie

      So far I've been able to resolve all of my other JBoss questions/issues by looking in these forums, however, I'm stumpped with this one issue.

      I am migrating our self-developed DB objects to Entity Beans. I am wanting to use CMP 2.0. My problem is that I want the pre-existing data in the table to be visisble.
      It seems that I only have visibility to the beans I create. In other words I can use my Entity bean to insert a new row into the DB, but, when I want to get information from the pre-existing data, it says that the primary key isn't found.

      Also, I am having to mix our self-developed DB objects with the new Entity beans while the migration isn't complete.
      And so I use our self-developed objects to return a list of the primary keys so that I can then call the "findByPrimaryKey()" method on our entity beans. When I do that, I get a warning about using LocalTransactionAccess or "prepared call from a local tx...". I am currenty using the same data source pool for
      both our self-developed DB objects and the EJB Container.
      Should I make two different DB pool sources to avoid the local tx thing?

      Thanks, cause I am pretty confused about what I need to do.

        • 1. Re: Pre-Existing Tables and Entity Beans
          Dain Sundstrom Master

          > So far I've been able to resolve all of my other
          > JBoss questions/issues by looking in these forums,
          > however, I'm stumpped with this one issue.

          Great to hear

          > I am migrating our self-developed DB objects to
          > Entity Beans. I am wanting to use CMP 2.0. My
          > problem is that I want the pre-existing data in the
          > table to be visisble.

          You can do this in most situations

          > It seems that I only have visibility to the beans I
          > create. In other words I can use my Entity bean to
          > insert a new row into the DB, but, when I want to get
          > information from the pre-existing data, it says that
          > the primary key isn't found.

          You should. Check the server log for the executed sql. Is the sql correct. If the sql is not in the log change the log level of the org.jboss.ejb.plugins.cmp to DEBUG in the log4j.xml file.

          > Also, I am having to mix our self-developed DB
          > objects with the new Entity beans while the migration
          > isn't complete.
          > And so I use our self-developed objects to return a
          > list of the primary keys so that I can then call the
          > "findByPrimaryKey()" method on our entity beans.
          > When I do that, I get a warning about using
          > LocalTransactionAccess or "prepared call from a
          > local tx...". I am currenty using the same data
          > source pool for
          > both our self-developed DB objects and the EJB
          > Container.

          I don't know much about the database pools, but usually warnings are ok.

          > Should I make two different DB pool sources to avoid
          > the local tx thing?

          Don't know.