Re: newbie problems

2006-04-19 Thread Dmitry Litvintsev

Thank you Armin, 

Please educate me a bit, cause I am a bit perplexed by your mail. 

You say OJB does not work well w/ JDO, use ODMG or PB

OK, I understand that. 

then you say:

> If you want to use JDO, please have a look at JPOX or Speedo (or other

JPOX is a implementation of JDO, isn't it? So can I use OJB w/ JPOX then?
Or should I just use JPOX ? (this indicates my confusion at what exactly 
OJB does on the top of JDO).  

Please help me out. 


On Wed, 19 Apr 2006, Armin Waibel wrote:

> Hi Dmitry,
> 
> I don't know what's going wrong when running the tutorial (seems that 
> Product.class was correctly enhanced by the JDO enhancer).
> But I wouldn't recommend OJB's JDO 1.0-api implementation for production 
> environments.
> The PB-api and ODMG-api are stable and ready for production use
> http://db.apache.org/ojb/status.html
> 
> If you want to use JDO, please have a look at JPOX or Speedo (or other 
> projects)
> http://www.jpox.org/index.jsp
> http://speedo.objectweb.org/
> 
> regards,
> Armin
> 
> Dmitry Litvintsev wrote:
> > 
> > Hi, 
> > 
> > I am developing a java application and I am considering OJB technology to 
> > store objects' states seamlessly in the PostgreSQL database. 
> > 
> > In short I am failing to get tutorial5 up and running. I followed 
> > instructions on this link:
> > 
> > http://db.apache.org/ojb/docu/tutorials/jdo-tutorial.html
> > 

-- 
Dmitri Litvintsev

/--\
| Tel:   (630) 840 5005|  
| FAX:   (630) 840 2968|  
|(630) 840 2783|  
| Pager:  847  536 6450|  
| office:WH8E 863  |
| E-mail:[EMAIL PROTECTED] |
\--/




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



newbie problems

2006-04-18 Thread Dmitry Litvintsev


Hi, 

I am developing a java application and I am considering OJB technology to 
store objects' states seamlessly in the PostgreSQL database. 

In short I am failing to get tutorial5 up and running. I followed 
instructions on this link:

http://db.apache.org/ojb/docu/tutorials/jdo-tutorial.html

My actions:

1) downloaded ojb-blank.jar
2) downloaded tutorial5-src.jar
3) downloaded db-ojb-1.0.4.jar
4) downloaded jdo.jar,jdori-enhancer.jar,jdori.jar (jdo 1.0.1 RI)
5) downloaded PostgreSQL drivers pg74.216.jdbc3.jar 
postgresql-8.1-405.jdbc3.jar 

my top directory is "ojb-blank"
I put *jar files into lib (ojb-blank/lib)
I put tutorial5 sources to (ojb_blank/src/java/org/apache/ojb/tutorial5)

I modified buid.properties, so it looks like this:

jcdAlias=default
databaseName=ojb
databaseUser=postgres
databasePassword=

dbmsName=PostgreSQL
jdbcLevel=3.0
jdbcRuntimeDriver=org.postgresql.Driver
urlProtocol=jdbc
urlSubprotocol=postgresql
urlDbalias=//localhost/${databaseName}

torque.database=postgresql
torque.database.createUrl=${urlProtocol}:${urlSubprotocol}:${urlDbalias}

jar.name=my-project.jar

source.dir=src
source.java.dir=${source.dir}/java
source.resource.dir=${source.dir}/resources
source.test.dir=${source.dir}/test
source.schema.dir=${source.dir}/schema

build.dir=build
lib.dir=lib

target.dir=target

I do not recall changing build.xml. 


1) DB setup

ant build setup-db

runs w/ errors, but it creates *.sql files which I run byu hand and 
next 
time around 

ant build setup-db

runs w/o errors. So I consider it is a success:
$ psql ojb
Welcome to psql 8.0.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
   \h for help with SQL commands
   \? for help with psql commands
   \g or terminate with semicolon to execute query
   \q to quit

ojb=# \d
   List of relations
 Schema |   Name| Type  |  Owner
+---+---+--
 public | ojb_dlist | table | postgres
 public | ojb_dlist_entries | table | postgres
 public | ojb_dmap  | table | postgres
 public | ojb_dmap_entries  | table | postgres
 public | ojb_dset  | table | postgres
 public | ojb_dset_entries  | table | postgres
 public | ojb_hl_seq| table | postgres
 public | ojb_nrm   | table | postgres
 public | product   | table | postgres
(9 rows)

2) ant build

$ ant build
Buildfile: build.xml

compile:
[mkdir] Created dir: /data/postgres/ojb/ojb-blank/build
[mkdir] Created dir: /data/postgres/ojb/ojb-blank/build/classes
[javac] Compiling 9 source files to 
/data/postgres/ojb/ojb-blank/build/classes

xdoclet:
[ojbdoclet] 2006-04-18 18:33:08,102 [main] INFO  
xdoclet.XDocletMain.start - Running 
[ojbdoclet] Generating ojb repository descriptor 
(build/repository_user.xml)
[ojbdoclet] Type org.apache.ojb.tutorial5.Product
[ojbdoclet] Processed 1 types
[ojbdoclet] Processed 1 types
[ojbdoclet] 2006-04-18 18:33:08,493 [main] INFO  
xdoclet.XDocletMain.start - Running 
[ojbdoclet] Generating torque schema (build/database/project-schema.xml)
[ojbdoclet] Processed 1 types

build:
 [copy] Copying 7 files to /data/postgres/ojb/ojb-blank/build
[mkdir] Created dir: /data/postgres/ojb/ojb-blank/build/lib
 [copy] Copying 41 files to /data/postgres/ojb/ojb-blank/build/lib

build_if_with_mainclass:
 [copy] Copying 2 files to /data/postgres/ojb/ojb-blank/build

BUILD SUCCESSFUL
Total time: 3 seconds

so I am encouraged , I proceed to the next step:

3) ant enhance-jdori

$ ant enhance-jdori

Buildfile: build.xml

compile:

xdoclet:
[ojbdoclet] 2006-04-18 18:34:35,546 [main] INFO  xdoclet.XDocletMain.start - 
Running 
[ojbdoclet] 2006-04-18 18:34:36,128 [main] INFO  xdoclet.XDocletMain.start - 
Running 

build:

build_if_with_mainclass:

enhance-jdori:
 [java] Enhancer: options:
 [java] verbose = true
 [java] quiet = false
 [java] forceWrite = true
 [java] noWrite = false
 [java] sourcePath = null
 [java] destinationDirectory = build/classes
 [java] propertiesFileName = null
 [java] doTiming = false
 [java] classNames = {
 [java] }
 [java] jdoFileNames = {
 [java] src/java/org/apache/ojb/tutorial5/Product.jdo
 [java] }
 [java] classFileNames = {
 [java]