Re: [JBoss-user] Re: blob field in cmp

2003-12-15 Thread Alexey Loubyansky
Can you try with JBossCMP engine instead of JAWS?

Just use

persistence-managerorg.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager/persistence-manager

in jboss.xml

forge wrote:

Thanks, Alexey.

Do you mean I should modify standardjaws.xml?

No, I didn't modify it.



I found following settings in jaws.xml:



nameDB2/name

mapping

   java-typejava.lang.Object/java-type

   jdbc-typeJAVA_OBJECT/jdbc-type

   sql-typeBLOB(2000)/sql-type

/mapping



Need I modify it?



Regards,

Forge







Message: 8


Date: Fri, 12 Dec 2003 14:09:04 +0200


From: Alexey Loubyansky [EMAIL PROTECTED]


Organization: JBoss Group Europe


To: [EMAIL PROTECTED]


Subject: Re: [JBoss-user] blob field in cmp


Reply-To: [EMAIL PROTECTED]



It's absolutely ok. You just need to configure the mapping, i.e. 


jdbc-type and sql-type. Do you specify both yourself or use the defaults?








--http://www.eyou.com
--...
--http://vip.eyou.com
--VIP  


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278alloc_id=3371op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278alloc_id=3371op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] Re: blob field in cmp

2003-12-15 Thread Alexey Loubyansky
I thought you used jboss.xml.
Do you use CMP1.1? What is the exception?
PS: please, keep it on jboss-user

forge wrote:

Hello, Alex

I couldn't find jboss in server/default/conf directory,
but there is a standardjboss.xml.
And I found the following lines in it:
persistence-managerorg.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager/persiste
nce-manager
I created a sample project in jbuilder, containing a cmp with 2 fields:
an Integer field as id and a byte[] field as photo.
When called ejbcreate, jboss throws db2.jdbc exception: invalid data type,
SQL= HY004.
I don't know what error I made.

Regards,
Forge


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278alloc_id=3371op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] Re: blob field in cmp

2003-12-14 Thread forge
Thanks, Alexey.

Do you mean I should modify standardjaws.xml?

No, I didn't modify it.



I found following settings in jaws.xml:



nameDB2/name

mapping

   java-typejava.lang.Object/java-type

   jdbc-typeJAVA_OBJECT/jdbc-type

   sql-typeBLOB(2000)/sql-type

/mapping



Need I modify it?



Regards,

Forge







Message: 8

Date: Fri, 12 Dec 2003 14:09:04 +0200

From: Alexey Loubyansky [EMAIL PROTECTED]

Organization: JBoss Group Europe

To: [EMAIL PROTECTED]

Subject: Re: [JBoss-user] blob field in cmp

Reply-To: [EMAIL PROTECTED]



It's absolutely ok. You just need to configure the mapping, i.e. 

jdbc-type and sql-type. Do you specify both yourself or use the defaults?








--http://www.eyou.com
--Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä  ÓïÒôÓʼþ  Òƶ¯ÊéÇ©  ÈÕÀú·þÎñ  ÍøÂç´æ´¢...ÒÚÓÊδ¾¡

--http://vip.eyou.com
--¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä  ×¢²áÄúÖÐÒâµÄÓû§Ãû




---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278alloc_id=3371op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] Re: BLOB

2001-07-14 Thread Eric Anderson

I've used CMP and BLOBs with JBoss in the past.  Declare the bean member variable that 
will hold your BLOB data as a byte[].  This will get mapped to the jdbc-type of 
JAVA_OBJECT.  Then check (standard)jaws.xml to see that the mapping for this exists.  
It looks like the mapping below - BLOB(2000) - was taken from the DB2 section of 
standardjaws.xml.  DB2 does not seem to have an arbitrary-sized BLOB type, you have to 
declare a maximum size for a BLOB in advance.  You might want to keep this in mind 
when choosing a database.  Postgres has a BLOB type of unlimited size. 

My experience doing BLOB inserts with Postgres and DB2 and with JBoss is that it's 
horribly slow.  I believe the database is the problem - DB2 was maybe 25% faster than 
Postgres but neither was fast enough for high-volume inserts, and this was with fairly 
small BLOBs - 10k-20k.  It's possible that the overall problem was not caused by the 
databases but by JAWS and/or RMI overhead.

One thing I'd like to figure out is how to do these BLOB operations while minimizing 
memory use at both the client and the server.  To make BLOBs work with CMP I've had to 
buffer the blob in memory as a byte[] member variable, both at the client and in the 
bean instance.  Is there a more efficient way to achieve the same thing?  It would be 
wonderful if you could declare an InputStream member and have the RMI serialization 
code read from this at the client w/o a lot of in-memory buffering.  I know that some 
JDBC drivers can handle InputStream parameters on PreparedStatements, but JAWS doesn't 
seem to support this.

Regards,
Eric

Message: 8
Date: Sat, 14 Jul 2001 03:04:25 -0700 (PDT)
From: Jason Dillon [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Subject: Re: [JBoss-user] BLOB
Reply-To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

It looks like JAWS can persist objects via BLOB... but that is just a simple
guess by looking at the standardjaws.xml, it has some lines that look like
this:

  mapping
java-typejava.lang.Object/java-type
jdbc-typeJAVA_OBJECT/jdbc-type
sql-typeBLOB(2000)/sql-type
  /mapping

Which would lead me to believe that you could get JAWS to persist to a record
with a BLOB column.  I would try it.

--jason



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Re: BLOB

2001-07-14 Thread Jason Dillon

 I've used CMP and BLOBs with JBoss in the past.  Declare the bean member
 variable that will hold your BLOB data as a byte[].  This will get mapped
 to the jdbc-type of JAVA_OBJECT.  Then check (standard)jaws.xml to see
 that the mapping for this exists.  It looks like the mapping below -
 BLOB(2000) - was taken from the DB2 section of standardjaws.xml.  DB2 does
 not seem to have an arbitrary-sized BLOB type, you have to declare a
 maximum size for a BLOB in advance.  You might want to keep this in mind
 when choosing a database.  Postgres has a BLOB type of unlimited size.

I just grep'd for a BLOB, then pasted it.  I have never even used DB2, so I
don't know why I picked that one =|

 My experience doing BLOB inserts with Postgres and DB2 and with JBoss is
 that it's horribly slow.  I believe the database is the problem - DB2 was
 maybe 25% faster than Postgres but neither was fast enough for high-volume
 inserts, and this was with fairly small BLOBs - 10k-20k.  It's possible
 that the overall problem was not caused by the databases but by JAWS
 and/or RMI overhead.

Perhaps you could fix that.

 One thing I'd like to figure out is how to do these BLOB operations while
 minimizing memory use at both the client and the server.  To make BLOBs
 work with CMP I've had to buffer the blob in memory as a byte[] member
 variable, both at the client and in the bean instance.  Is there a more
 efficient way to achieve the same thing?  It would be wonderful if you
 could declare an InputStream member and have the RMI serialization code
 read from this at the client w/o a lot of in-memory buffering.  I know
 that some JDBC drivers can handle InputStream parameters on
 PreparedStatements, but JAWS doesn't seem to support this.

As far as I know there is no way to remote an InputStream (or
OutputStreams).  As far as JAWS supporting InputStream params, I would say
again, perhaps you could fix that.  If it does exist, perhaps you could
document it.

Necessity is the mother of invention.  If you need it, then give it life.

--jason



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user