cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JD Daniels" ...@datatrio.com>
Subject Re: Flow Database stuff ( The new FOM? )
Date Thu, 10 Jul 2003 09:23:53 GMT
I definately plan to write up some stuff on what it took to get me running.
I have taken a few clients and used cocoon to solve small, specific issues
with alot less hassle and better maintainablity than PHP/PERL has proven to
be.

I have taken an in house project (An office manger to track our time and
project issues) and am developing it with flow. we use it everyday, and alot
of time is spent hack-hack-hacking. alot is still in xsp.. just because it
is faster to build. Once I get it all usable, I will start writing wiki on
where I got stuck (Being new to java)

The issue I am having right now is this one:

http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105612521608516&w=2

After I saw the recent activity on the FOM, I gave it a go, but waaayy over
my head for now.

Basically.. I have sitemap match a lookup time ticket form, which calls a
JXForm (sitemap calls jxform function), then displays the results. ( I used
the petstore sample to get me going.) The error happens if someone else logs
in from another machine. and does the same action. The first person in gets
cannot convert null to an object. Seems that the second user's database
connection bumps the first one into nothingness.

I tried to implement the change posted to the list, (In the above thread),
but I must be mixed up about what has been changed in the cvs, because I got
a nullpointer errors loading JXForms.js in my flowscript.

So I thought I would try to figure out what the best practice for this would
be :)

JD

----- Original Message -----
From: "Reinhard Pötz" <reinhard_poetz@gmx.net>
To: <dev@cocoon.apache.org>
Sent: Thursday, July 10, 2003 12:04 AM
Subject: RE: Flow Database stuff ( The new FOM? )


> From: JD Daniels
>
> > ok, I am confused on what is happening to the Datbase.js
> > file. but instead of a request for the long explanation, I
> > will settle for a quick yes or no.
> >
> > I am a java newbie... so bear with me...
> >
> > From the petstore:
> >
> >         // temporary hack to avoid requiring datasource
> > config in cocoon.xconf
> >         java.lang.Class.forName("org.hsqldb.jdbcDriver");
> >         var jdbc =
> > java.sql.DriverManager.getConnection("jdbc:hsqldb:.",
> > "sa", "")
> >         var conn = new Database(jdbc);
> >         if (this.hsql == null) {
> >             // keep hsql in-memory database alive
> >             this.hsql =
> > java.sql.DriverManager.getConnection("jdbc:hsqldb:.", "sa", "");
> >         }
> >         return conn;
> >     } else {
> >         // lookup datasource in cocoon.xconf
> >         return Database.getConnection(id);
> >     }
> >
> > Is what has been talked about here on the list mean the "Best
> > Practice" way to get a database connection in flow is the way
> > that is commented here as a "temporary hack" ie. use
> > java.lang.whatever and code as if we were writing the app in
> > pure java?
>
> IMO no. I would use Object/Relational mapping tools like OJB
> http://db.apache.org/ojb/ or Hibernate (http://hibernate.bluemars.net).
>
>
> > Is there a wiki somewhere on this type of thing?
>
> http://wiki.cocoondev.org/Wiki.jsp?page=XMLFormJXFormHibernateAndFlowscr
> ipt
> and here you find a component providing a Hibernate session:
> http://cvs.werken.com/viewcvs.cgi/plexus-components/hibernate
> /src/java/org/apache/plexus/hibernate/DefaultHibernateService.java?cvsro
> ot=plexus
>
> > (I have been
> > building apps in PHP and PERL for a few years, and its gets
> > frustrating KNOWING way better tools are RIGHT HERE in front of me :)
>
> Currently we are finishing the flow itself and try to find a way how to
> continue with XMLForms/JXForms in the future. After this we will have
> to write *a lot of* documentation. I know, this doesn't help you
> right now but of course we can help you here on the cocoon mailing
> lists.
>
> ;-) hint: We would be very pleased if you could help us writing
> some of the docs that guide other users into the right direction if they
> have similar problems (espacially as you have a lot of knowledge in
> other
> languages/framworks and this is of course one of our most important
> target
> groups)
>
> > Sorry if this is a pain  in the *** question, bu tthe idea of
> > flow has me giddy. But I am stuck on the "cannot convert null
> > to an object issue"
>
> Where do you get this error? Usually this happens if you change your
> scripts and the context is reset and all variables are reset.
>
> Cheers,
> Reinhard
>
>
>


Mime
View raw message