8 Replies Latest reply on Sep 19, 2006 11:56 AM by asd asdsda

    the database of  Seam application

    asd asdsda Newbie

      in the first Seam application: the registration example the tutorial speaks about users table, database,ecc.ecc but i have not installed no database

      what kind of database is it?
      where is it?

      thanks

        • 1. Re: the database of  Seam application
          Gavin King Master

          It is a HSQLDB database, embedded in JBoss.

          • 2. Re: the database of  Seam application
            asd asdsda Newbie

             

            "gavin.king@jboss.com" wrote:
            It is a HSQLDB database, embedded in JBoss.


            and how can i see this database??
            do i loose my data when i stop jboss?

            thanks

            • 3. Re: the database of  Seam application
              hdslkf hklsdg Apprentice

              By default yes. The data is only stored in memory. So all your bookings get lost. The hotels are only still there cause they are created upon starting the server. There's a file called import.sql that contains the hotels ;).

              But there is a possibility to save the data on the disk instead. I'm not sure how this works exactly (I'm too lazy to search for that in the docs right now *g*).

              This is even quite interesting for Java SE. You can easily create standalone desktop applications with a built-in database by using Hibernate and HSQLDB... or let's say I hope this is possible ;).

              • 4. Re: the database of  Seam application
                asd asdsda Newbie

                 

                "bfo81" wrote:
                By default yes. The data is only stored in memory. So all your bookings get lost. The hotels are only still there cause they are created upon starting the server. There's a file called import.sql that contains the hotels ;).

                But there is a possibility to save the data on the disk instead. I'm not sure how this works exactly (I'm too lazy to search for that in the docs right now *g*).

                This is even quite interesting for Java SE. You can easily create standalone desktop applications with a built-in database by using Hibernate and HSQLDB... or let's say I hope this is possible ;).


                and how can i see this database??
                there is a way to see the data?

                thanks

                • 5. Re: the database of  Seam application
                  Norman Richards Master

                  They hypersonic database files are in the server/default/data/hypersonic directory. Changes to the hypersonic database are NOT lost when JBoss stops. However, the example applications use the create-drop table generation strategy, which causes the tables to be deleted when the apps are redeployed.

                  To see the data, look in the jmx-console for the database manager MBean. There is a start database manager operation that will launch a GUI admin tool.

                  • 6. Re: the database of  Seam application
                    asd asdsda Newbie

                    at the url:
                    http://localhost:8080/

                    i see these links:

                    JBoss Documentation
                    JBoss Wiki
                    JBoss JIRA
                    JBoss Forums

                    Tomcat status (full) (XML)
                    JMX Console
                    JBoss Web Console

                    i click on JMX Console and i see a lot of links

                    what i have to do??

                    thanks

                    • 7. Re: the database of  Seam application
                      Norman Richards Master

                      Woops - that'll teach me to not look at that example. The original poster was right that the hypersonic instance in the booking example is entirely in memory. We normally don't recommend using a private instance like this, but it works for the example. To use the JBoss-managed HSQL instance, change the connection-url in booking-ds.xml to:

                      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>


                      Redeploy the application (not just the datasource) and then from the JMX console, find the jboss:database=localDB,service=Hypersonic MBean. Click the link, then invoke the startDatabaseManager operation. You'll see your data.

                      You can look at the DVD store for another example. The DVD store uses it's own HSQL instance, but it registers it as a proper MBean so you can manage the data.

                      Hope that helps.

                      • 8. Re: the database of  Seam application
                        asd asdsda Newbie

                        thanks

                        now it works also for other examples (seam-messages, ecc.ecc.)