Re: MSSQL And OJB/Torque issue with image datatype..Will Velocity solve my problem?

2004-09-09 Thread Brian McCallister
This is a limitation of (MS) SQL:
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the query (for a com.xxx.Property): The text,
ntext, and image data types cannot be compared or sorted, except when
using IS NULL or LIKE operator.
What does the actual SQL look like, and what does the query you are 
running look like?

-Brian
On Sep 8, 2004, at 10:07 PM, Ajitesh Das wrote:
Hi:
I want to store an *supersize* byte array into a db table.
Below I have described the issues that I have. My question:
How do I control SQL for Schema? Do I have to write my own Velocity
template and add that path to db.profile.



I have made the followings changes:


DB Type : MSSQL

In db-schema.xml:

?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE database SYSTEM
http://jakarta.apache.org/turbine/dtd/database.dtd;
database name=@DATABASE_DEFAULT@ defaultIdMethod=none baseClass=

  table name=PROPERTY 
column name=ID required=true primaryKey=true
type=INTEGER 
/column
column name= PROPERTY_NAME required=true 
primaryKey=false
type=VARBINARY 

/column
column name=PROPERTY_VALUE required=true 
primaryKey=false
type=VARBINARY 

/column
 /table
/database

It creates IMAGE datatype in MSSQL Server.

In repository.xml:
class-descriptor
class=com.xxx.Property
table=PROPERTY


attribute
attribute-name=DB_NAME
attribute-value=mydb

/attribute

field-descriptor id=1
name=dbId
column=ID
jdbc-type=INTEGER
primarykey=true
nullable=false
indexed=true
autoincrement=true
locking=false
default-fetch=false
/
field-descriptor id=2
name=propertyName
column=PROPERTY_NAME
jdbc-type=VARBINARY
primarykey=false
nullable=true
indexed=false
autoincrement=false
locking=false
default-fetch=false
conversion=com.xxx.yyy.Converter
/
field-descriptor id=3
name=propertyValue
column=PROPERTY_VALUE
jdbc-type=VARBINARY
primarykey=false
nullable=true
indexed=false
autoincrement=false
locking=false
default-fetch=false
conversion=com.xxx.yyy.Converter
/
/class-descriptor

When I run simple queryI get the following exception: but running in
MySQL is fine.


[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the query (for a com.xxx.Property): The text,
ntext, and image data types cannot be compared or sorted, except when
using IS NULL or LIKE operator.
The text, ntext, and image data types cannot be compared or sorted,
except when using IS NULL or LIKE operator.
java.sql.SQLException: The text, ntext, and image data types cannot be
compared or sorted, except when using IS NULL or LIKE operator.

   at
net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.j
ava:366)
  at
net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:1992)
at
net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:1594)
at
net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:490)
at
net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement
.java:262)
at
net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPrep
aredStatement.java:614)
at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
 Source)
at org.apache.ojb.broker.accesslayer.RsIterator.init(Unknown
Source)
at
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unk
nown Source)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQue
ry(Unknown Source)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery
(Unknown Source)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorByQuery(U
nknown Source)
at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getIteratorByQ
uery(Unknown Source)

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


JDO Enhancing error

2004-09-09 Thread GuptaTTG



Hi

I am getting following error while running the 
Enhancer 

com.sun.jdori.enhancer.util.InternalError: 
assertion failed: JDO metadata: managed fields exceed annotated 
fields. at 
com.sun.jdori.enhancer.util.Assertion.affirm(Unknown 
Source) at 
com.sun.jdori.enhancer.core.Analyzer.scanFields(Unknown 
Source) at 
com.sun.jdori.enhancer.core.Analyzer.scan(Unknown Source) 
at com.sun.jdori.enhancer.core.Controller.scan(Unknown 
Source) at 
com.sun.jdori.enhancer.core.Controller.enhanceClass(Unknown 
Source) at 
com.sun.jdori.enhancer.filter.Enhancer.enhanceClassFile1(Unknown 
Source) at 
com.sun.jdori.enhancer.filter.Enhancer.enhanceClassFile(Unknown 
Source) at 
com.sun.jdori.enhancer.Main.enhanceClassFile(Unknown 
Source) at 
com.sun.jdori.enhancer.Main.enhanceInputFiles(Unknown 
Source) at com.sun.jdori.enhancer.Main.process(Unknown 
Source) at com.sun.jdori.enhancer.Main.main(Unknown 
Source)Fatal error while enhancing: JDO ENHANCER: An internal error occurred 
while enhancing input class; detailed message: assertion failed: JDO metadata: 
managed fields exceed annotated 
fields.com.sun.jdori.enhancer.EnhancerFatalError: JDO ENHANCER: An internal 
error occurred while enhancing input class; detailed message: assertion failed: 
JDO metadata: managed fields exceed annotated fields. at 
com.sun.jdori.enhancer.filter.Enhancer.enhanceClassFile(Unknown 
Source) at 
com.sun.jdori.enhancer.Main.enhanceClassFile(Unknown 
Source) at 
com.sun.jdori.enhancer.Main.enhanceInputFiles(Unknown 
Source) at com.sun.jdori.enhancer.Main.process(Unknown 
Source) at com.sun.jdori.enhancer.Main.main(Unknown 
Source)aborted with errors.

The java file is attached and the corresponding 
entry in the package.jdo is :class name="ICP_ACL_PRIV_COMPANY" 
identity-type="datastore" field name="bU_ID" 
persistence-modifier="persistent" extension 
vendor-name="ojb" key="column" value="BU_ID"/ 
/field field name="rULE_ID" 
persistence-modifier="persistent" extension 
vendor-name="ojb" key="column" value="RULE_ID"/ 
/field/class

Could somebody give 
me a clue on what's wrong in my code.

Thanks and 
Regards
Tarun 
Gupta
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: JDO Enhancing error

2004-09-09 Thread GuptaTTG
I got it worked, the issue was that I was ignoring the fact that the
attribute names are case sensitive 
 
Could anybody tell if OJB supports the functionality of specifying Fetch
groups in the queries like in case of Kodo (Which I know that its not a JDO
standard)
If not then How can I achieve the same thing in OJB
 
Thanks and Regards
Tarun Gupta

-Original Message-
From: Gupta, Tarun TG (GXS) 
Sent: Thursday, September 09, 2004 4:41 PM
To: OJB Users List
Subject: JDO Enhancing error


Hi
 
I am getting following error while running the Enhancer 
 
com.sun.jdori.enhancer.util.InternalError: assertion failed: JDO metadata:
managed fields exceed annotated fields.
at com.sun.jdori.enhancer.util.Assertion.affirm(Unknown Source)
at com.sun.jdori.enhancer.core.Analyzer.scanFields(Unknown Source)
at com.sun.jdori.enhancer.core.Analyzer.scan(Unknown Source)
at com.sun.jdori.enhancer.core.Controller.scan(Unknown Source)
at com.sun.jdori.enhancer.core.Controller.enhanceClass(Unknown Source)
at com.sun.jdori.enhancer.filter.Enhancer.enhanceClassFile1(Unknown
Source)
at com.sun.jdori.enhancer.filter.Enhancer.enhanceClassFile(Unknown
Source)
at com.sun.jdori.enhancer.Main.enhanceClassFile(Unknown Source)
at com.sun.jdori.enhancer.Main.enhanceInputFiles(Unknown Source)
at com.sun.jdori.enhancer.Main.process(Unknown Source)
at com.sun.jdori.enhancer.Main.main(Unknown Source)
Fatal error while enhancing: JDO ENHANCER: An internal error occurred while
enhancing input class; detailed message: assertion failed: JDO metadata:
managed fields exceed annotated fields.
com.sun.jdori.enhancer.EnhancerFatalError: JDO ENHANCER: An internal error
occurred while enhancing input class; detailed message: assertion failed:
JDO metadata: managed fields exceed annotated fields.
at com.sun.jdori.enhancer.filter.Enhancer.enhanceClassFile(Unknown
Source)
at com.sun.jdori.enhancer.Main.enhanceClassFile(Unknown Source)
at com.sun.jdori.enhancer.Main.enhanceInputFiles(Unknown Source)
at com.sun.jdori.enhancer.Main.process(Unknown Source)
at com.sun.jdori.enhancer.Main.main(Unknown Source)
aborted with errors.
 
The java file is attached and the corresponding entry in the package.jdo is
:
class name=ICP_ACL_PRIV_COMPANY identity-type=datastore
   field name=bU_ID persistence-modifier=persistent
extension vendor-name=ojb key=column value=BU_ID/
   /field
   field name=rULE_ID persistence-modifier=persistent
extension vendor-name=ojb key=column value=RULE_ID/
   /field
/class
 
Could somebody give me a clue on what's wrong in my code.
 
Thanks and Regards
Tarun Gupta



RE: JBoss have to close connection in managed environment and nes ted EJB calls

2004-09-09 Thread Clute, Andrew
I don't know if this was every acknowledged on the list, my Jboss recognizes that they 
do it this way, and it is how they want to do it.

You can turn off the Connection checking.

http://www.jboss.org/wiki/Wiki.jsp?page=WhatDoesTheMessageDoYourOwnHousekeepingMean

See Thread Local Pattern

-Andrew

 

-Original Message-
From: André Markwalder [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 05, 2004 5:09 AM
To: OJB Users List
Subject: RE: JBoss have to close connection in managed environment and nes ted EJB 
calls

Hi Armin,

Thanks for spending hours of investigation.

I think it is absolutely correct, that OJB uses only one PersistenceBroker and as you 
described it seems that it is a problem of JBoss.

Again thanks a lot for your detailed description.

regards,
André



-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED]
Sent: Samstag, 3. Juli 2004 17:45
To: OJB Users List
Subject: Re: JBoss have to close connection in managed environment and nes ted EJB 
calls


Hi Andre,

after spending hours of investigation, I think I found the reason for the warning.

Seems JBoss doesn't recognize a connection.close() call when:
- bean 1 create a PB instance and do some work
- in bean 1 another bean (bean 2) was used
- bean 2 create a PB instance. Internal OJB use the same PB instance, thus both use 
the same internal PB instance wrapped by different handle. 
The use PB was already associated with a connection in bean 1, thus bean
2 use the same connection handle.
- now bean 2 close the used PB handle, internal the PB instance only release/close the 
used connection
- now bean 1 perform additional work, thus the PB instance create a new connection 
(because bean 2 close it) and close it after use (PB close call in bean 1)
- bean 1 method ends and the container commit the transaction

Now the problem occur, because JBoss does not recognize that the first connection 
created in bean 1 was closed in bean 2 and log a warning about unclosed connection.

If you comment out line 110 in PersistenceBrokerFactorySyncImpl or use version 1.5 of 
PersistenceBrokerFactorySyncImpl the warning does not occur.

In version 1.6 I introduce that different beans in the same tx use internal the same 
PB instance (think this is similar to DataSource
handling) to avoid massive PB instance creation for bean in bean calls.

See
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]m
sgId=1693533

The question now is are OJB wrong in handling connections or should JBoss allow this? 
I'm don't know the answer.


**
Here is my test:

Have a look how OJB handles connection '[EMAIL PROTECTED]'
(the bean source code can be found below)

--- test start an lookup first PB in first bean
...
16:53:17,625 INFO  [CacheDistributor] Create new 
ObjectCacheImplementation for 'default'
16:53:17,625 INFO  [STDOUT]  lookup con: 
[EMAIL PROTECTED] 
connection=org.jboss.resource.adapter
[EMAIL PROTECTED]: false
16:53:17,625 INFO  [STDOUT] ## broker1: 
[EMAIL PROTECTED] 
connection=org.jboss.resource.adapter.
[EMAIL PROTECTED]

--- query in first bean, connection was created, now we call the nested 
bean

16:53:17,625 INFO  [STDOUT] ### DO nested bean call
16:53:17,625 INFO  [PersonArticleManagerPBBean] ** Found bean: 
org.apache.ojb.ejb.pb.ArticleManagerPBBeanLocal:Stateless
16:53:17,640 INFO  [STDOUT]  lookup con: 
[EMAIL PROTECTED] 
connection=org.jboss.resource.adapter
[EMAIL PROTECTED]: false
16:53:17,640 INFO  [PersistenceBrokerImpl] Cascade store for this 
reference-descriptor (category) was set to false.
...

16:53:17,656 INFO  [STDOUT]  lookup con: 
[EMAIL PROTECTED] 
connection=org.jboss.resource.adapter
[EMAIL PROTECTED]: false
16:53:17,656 INFO  [PersistenceBrokerImpl] Cascade store for this 
reference-descriptor (category) was set to false.
16:53:17,656 INFO  [STDOUT]  lookup con: 
[EMAIL PROTECTED] 
connection=org.jboss.resource.adapter
[EMAIL PROTECTED]: false
16:53:17,671 ERROR [STDERR]  release connection: 
[EMAIL PROTECTED] 
connection=org.jboss.resource
[EMAIL PROTECTED] thread: Thread[RMI TCP 
Connection(2)-217.224.94.148,5,RMI Runtime]
16:53:17,671 INFO  [STDOUT]  close con: 
[EMAIL PROTECTED]
16:53:17,671 INFO  [STDOUT]  is closed: true
16:53:17,671 INFO  [STDOUT] ### END nested bean call

--- nested bean call is finished and '[EMAIL PROTECTED]' is 
closed!! But the second bean close the connection created by the first bean.
bean1 now start to insert objects and create a new connection, because 
the first one was closed by the nested bean


16:53:17,671 INFO  [STDOUT] ## broker1: now store objects
16:53:17,671 INFO  [STDOUT]  create con: 
[EMAIL PROTECTED] 
connection=org.jboss.resource.adapter
[EMAIL PROTECTED]
16:53:17,671 INFO  [STDOUT]  lookup con: 
[EMAIL PROTECTED] 
connection=org.jboss.resource.adapter
[EMAIL PROTECTED]: false
16:53:17,671 INFO  [STDOUT]  lookup con: 
[EMAIL PROTECTED] 

Re: When Should we use m_parentStatement in SqlQueryStatement?

2004-09-09 Thread Jakob Braeuchi
hi gene,
this instvar is not null if the statement is a subquery (see getSubQuerySQL() ).
hth
jakob
Gene schrieb:
Anyone can tell me in which circumstance will m_parentStatement(which is also a 
instance of SqlQueryStatement) NOT be null? Please give me a example.

Thanks in advance.
Gene
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Hsqldb validation query

2004-09-09 Thread David Durham
What's a good Hsql validation query?
- Dave
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


OJB under Oracle 10g ?

2004-09-09 Thread Andy Malakov
Hello All,

Has anybody tried to use OJB with Oracle 10g?

More specifically with OC4J application server?

The reason I am asking is that I am getting some exceptions and after I patch some of 
them, I am getting more of a different kind :-) Thus, I wonder has anybody actually 
used OJB with Oracle 10g?

(I have been using OJB with Oracle9i/OC4J/Orion with no problems.)

Thanks,
Andy


maven+ojb

2004-09-09 Thread Pedro Salgado

  I am searching the ibiblio repository and I cant find ojb 1.0rc7 anywhere
(just db-ojb-1.0.rc6.jar - 7 Apr 2004)... isnt it supposed to be on
ojb/jars?

  I do see the ojb-xdoclet-module (16 Aug 2004)...

  Thank you,

Pedro Salgado


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



Re: maven+ojb

2004-09-09 Thread Brian McCallister
http://www.ibiblio.org/maven/ojb/jars/
Includes the 1.0.1 I pushed last night.
-Brian
On Sep 9, 2004, at 7:38 PM, Pedro Salgado wrote:
  I am searching the ibiblio repository and I cant find ojb 1.0rc7 
anywhere
(just db-ojb-1.0.rc6.jar - 7 Apr 2004)... isnt it supposed to be on
ojb/jars?

  I do see the ojb-xdoclet-module (16 Aug 2004)...
  Thank you,
Pedro Salgado
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


MULTIPLE TABLES - DATA retrieval

2004-09-09 Thread kishore talagadadeevi
I really appreciate if someone could suggest me on the following ..
I have three independent tables  .
All three tables have part_num and part_serial as part of composite primary 
key in addition to other columns.

Question: How do I retrieve  qty,cost and size by joining all three tables 
on part_num and
 part_serial columns using OJB ???

 How do I define this scenario as a class descriptor  in 
repository.xml file ???


   T_PARTA  T_PARTB  T_PARTC
part_num(pk)   part_num(pk)part_num(pk)
part_serial(pk)  part_serial(pk)
part_serial(pk)
system(pk)  type(pk)
dimension(pk)
qty cost  size


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