Re: [Hibernate] Re: slow performance on flush

2002-11-25 Thread Juozas Baliuka
It is better to use some "native" API like "COPY" for long running import, some RDBM's support imports without constaint checks, SQL parsing , and sometimes "long running import" becomes very "short". - Original Message - From: "Christoph Sturm" <[EMAIL PROTECTED]> To: "Gavin King"

Re: [Hibernate] Re: slow performance on flush

2002-11-25 Thread Juozas Baliuka
> The stuff you mention sounds cool, and I already thought about that, but to > my knowledge there's no java api that supports stuff like that. If you know > a api that supports such functionality, please tell me, that would be really > great! > > regards > chris >

Re: [Hibernate] Postgres problem - idle in transaction.

2003-01-03 Thread Juozas Baliuka
Try DBCPConnectionProvider. - Original Message - From: "Jim Downing" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 03, 2003 10:24 PM Subject: [Hibernate] Postgres problem - idle in transaction. > Hi all, > > I have a problem with hibernate and postgresql that I suspe

Re: [Hibernate] persister/cglib

2003-02-04 Thread Juozas Baliuka
Your need to extend cirrus.hibernate.impl.SessionFactoryImpl to solve this problem, class generated by cglib extends op.model.OPShippingMarks, try something like this: public ClassPersister getPersister(Class theClass) throws MappingException { try{ return super.getPersister( theClass);

Re: [Hibernate] Dirty checking and int/boolean arrays

2003-02-11 Thread Juozas Baliuka
I have converted code to use BitSet , but see no better performance (not trivial to test). BitSet creates "small" arrays It is important for some JVM implemetations (not trivial to handle memory fragmentation), but possible optimizes nothing on current implementations. possible there is no optimiz

Re: [Hibernate] Re: Trouble with proxy implementations

2003-02-02 Thread Juozas Baliuka
MetaClass implementation is deefined in the same package, but it is no test for package methods. > Very, very cool > > One more request: is it possible to support this for package-visibility > methods by generating the MetaClass in the same package? (Might have to > have a different instance

Re: [Hibernate] Problem with Connection Pool Timeouts

2003-01-09 Thread Juozas Baliuka
Yes, I forgot this DBCP "feature", validation query has no effect if "testOnReturn" or "testOnBorrow" is not set. "testOnReturn" is not very meaningfull, but you must set "testOnReturn" to true if "validationQuery" is set. > As a follow-up to my last message, DBCP still times out, > even with th

[Hibernate] mapping

2002-12-23 Thread Juozas Baliuka
Is it possible to use some "custom" format for mapping without transformations to XML ? I want to implement some experimental definition language and use it with hibernate, but can't find ways to plug mapping layer without code modifications. ---

Re: [Hibernate] Trouble with proxy implementations

2003-02-01 Thread Juozas Baliuka
; So just let me know when you have something reasonably final. > > Thanks :) > > - Original Message - > From: "Juozas Baliuka" <[EMAIL PROTECTED]> > To: "Schnitzer, Jeff" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Cc: <[EMAI

Re: [Hibernate] Java-based query evaluator

2002-12-06 Thread Juozas Baliuka
> I'm curious how feasible it would be to write a Java-based evaluator of > Hibernate queries, or at least leverage the existing parser code to gain > access to the abstract syntax tree. > > One possibility is that certain subsets of queries (most filters, I > think) could be run within the JVM, s

Re: [Hibernate] saving to pgsql

2003-01-03 Thread Juozas Baliuka
postgres closes connection if it detects error in protocol, something like this can produce this error: char c = '\u'; String query = "select " + c; statement.execute(query);// error not detected by driver, server closes connection; I am not sure about all driver versions, but it must be possib

Re: [Hibernate] Trouble with proxy implementations

2003-02-02 Thread Juozas Baliuka
rect delegation to "super" ( this.method()->MethodProxy.invokeSuper(this)->this.CGLIB$ACCESS_x_method()-> super.method() ) "invoke" - direct delegation to "delegate" ( this.method()->MethodProxy.invoke(param)->param.method() ) I see we will have nice

[Hibernate] [patch] validation query

2002-12-22 Thread Juozas Baliuka
Hi, this feature was sugested on forum. I do not want to send my hibernate.properties, it is modified . Is it possible to remove hibernate.properties file from cvs and add hibernate.properties.sample ? (I need to modify this file every time I update) #hibernate.dbcp.validationQuery "SELECT 1 FRO

Re: [Hibernate] Dynamic Proxies

2003-02-16 Thread Juozas Baliuka
I am not sure, but I think it is no way good way to persist proxies at this time. It is possible to register custom persister for class, but hibernate will not find it by generated name, you need to implement SessionFactory.getPersister to find persister. - Original Message - From: "Gordon

[Hibernate] Dirty checking and int/boolean arrays

2003-02-09 Thread Juozas Baliuka
Hi, I see TypFactory, ClassPersister and all implementations use arrays of ints to store flags, It is not very performant and adds some grabage to code. java.util.BitSet is implemented for this use case (it is possible to implement something faster for this use case too). Can I break interfaces,

[Hibernate] Re: Glarch$$EnhancedByCGLIB$$3 (Repeative method name/signature) and deadlock

2002-11-07 Thread Juozas Baliuka
Hi, I found this in archyve. It is bug in cglib, updated rc2 has fix for "writeReplace", but it has bug in "MyClass.class" implementation, it dublicates "findClass(String name)", Class init hasbug too, it fails if argument count > 6 in method "myMethod(int arg1,int arg2,int arg3,int arg4,int arg5,i

Re: [Hibernate] Unit Testing With ThreadLocal Sessions

2003-08-06 Thread Juozas Baliuka
> I don't close the session at all in any of my business logic methods. In > deployment, a servlet filter _always_ closes the session at the end of the It looks like not the good way for performance. As I understand "doFilter()" returns after output is sent and connection is open/locked too lo

Re: [Hibernate] Hooking into Hibernate classloader

2002-11-07 Thread Juozas Baliuka
Is Reflect helper used to load classes ? It can be a problem on some app servers : public static Class classForName(String name) throws ClassNotFoundException { try { return Thread.currentThread().getContextClassLoader().loadClass(name); } catch (Exception e) { return Class.forName(n

Re: [Hibernate] Hibernate vs. Castor example

2002-12-01 Thread Juozas Baliuka
It can be a problem in "transient state": Parent p = new Parent(); Child c = new Child(); c.setParent(p); assertTrue("parent must have a child", p.getChildren() != 0 ); there are two possible solutions : 1) implement "void setParent(Parent p){ this.p = p; p.getChildren().add(this); }

Re: [Hibernate] IncompatibleClassChangeError when trying to create a datastore

2003-01-15 Thread Juozas Baliuka
Try to upgrade Ant or use "forke" to execute tests outside Ant JVM, xml parser loaded by Ant conflicts with hibernate. > Just found this entry in the FAQ about junit, will give that a try first. > Sorry for bugging the list. (Although it would be nice to know the jars and > versions that are nec

[Hibernate] workaround for postgresql driver bug

2003-02-19 Thread Juozas Baliuka
Hi, I have problems with postgresql <= 7.2 and "large" tables. PostgreSQL server uses "typed" indexes, if indexed field and constant is not the same type, index is not used. Driver sends long constant as int ( it must cast it to int8 or convert to string ) test=# \timing Timing is on. test=# select

Re: [Hibernate] List -> ArrayList

2003-01-16 Thread Juozas Baliuka
tPropertyList(int index) and setPropertyList(int index, > ArrayList). > > The the convert method below dies and doesn't work: > > BeanUtils.copyProperties(cmcfForm, c); > > returns null for my Lists on my object?? > > Any ideas? > > -Original Message- >

Re: [Hibernate] remotely access persistent objects

2003-02-18 Thread Juozas Baliuka
This use case like > obj.setY(2); > obj.setZ(3); > foo.flush(obj); looks like object database. I think it is good idea to implement some simple framework/Hibernate server mode. I prefer language neutral and pluggable RPC, some of my client side applications are native windows applicati

[Hibernate] currentSession

2003-01-09 Thread Juozas Baliuka
I see, TreadLocal stuff becomes popular and I think it can be implemented in SessionFactory.currentSession(); Session can be mapped to Thread in "standalone" mode and to JTA Transaction in "managed" mode (Transaction is mapped to Thread in JTA too). Factory implementation opens it once per transac

Re: [Hibernate] CodeGenerator

2002-12-29 Thread Juozas Baliuka
equals() and hashCode() can be implemented using this definition : for all persistent objects a, b : a.equals(a) === true a.equals(b) ==> b.equals(a) a.equals(b) ==> a.hashCode() = b.hashCode() a is persistent ==> a.getId() != null a.equals(b)

Re: [Hibernate] DynaBean components

2003-01-19 Thread Juozas Baliuka
It was idea in cglib to implement true "DynaBean", but I can not find use case for this stuff (possible as workaround for some Bean, but not Map enabled scripting languages). As I understand "DynaBean" form [beanutils] is some kind of adapter for map, why do not to use "normal" Map directly ? >

Re: [Hibernate] Trouble with proxy implementations

2003-01-31 Thread Juozas Baliuka
This public method implemented for *all* proxy instances. Proxy implements net.sf.cglib.Factory interface it is used for optimization to eleminate reflection. We can rename getters and setters, but it is public API and you can filter methods this way: public boolean accept(){ return net.sf.cglib

Re: [Hibernate] Problems with hibernate.jar on a shared webapp

2002-12-25 Thread Juozas Baliuka
Hi, Iam afraid security stuff is undocumented but try this: grant permissions in policy configuration, I see hibernate doe's not have permissions to read system properties: >at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1259) > at java.lang.System.getProperties(Sys

[Hibernate] Close prepared statement

2003-02-16 Thread Juozas Baliuka
Hi, It is about possible memory leak. public PreparedStatement prepareQueryStatement(String sql, boolean scrollable) throws SQLException, HibernateException { ... statementsToClose.add(ps); // strong reference on statement return ps; } //-

Re: [Hibernate] Dirty checking and int/boolean arrays

2003-02-15 Thread Juozas Baliuka
I have removed my code with BitSets, this code is more readable, but it changes public API too mutch. > > BitSet creates "small" arrays It is important for some JVM > > implemetations (not trivial to handle memory fragmentation), > > but possible optimizes nothing on current implementations. > >

Re: [Hibernate] remotely access persistent objects

2003-02-17 Thread Juozas Baliuka
see http://www.enterpriseobjectbroker.org/, I think it must be interesting for you. > I'm wondering how many people would like to access persistent objects from a > remote client > directly. I guess most people use servlets/JSP, in which case they don't > care about remote > accessibility. > > Loo

Re: [Hibernate] List -> ArrayList

2003-01-12 Thread Juozas Baliuka
try this : public Object convert(Class type, Object value) { if (log.isDebugEnabled()) { log.debug("entering 'convert' method"); } // for a null value, return null if (value == null) { return null; }else if ( value.getClass().isAssignableFrom(type) ){

Re: [Hibernate] CGLib problem

2003-08-26 Thread Juozas Baliuka
jars from http://www.ibiblio.org/maven/cglib/jars/ are without dependancies, you need BCEL or ASM as dependancy . bcel 5.0 You can download cglib-asm-1.0.jar and use it in single jar too ( ASM is "faster" ). - Original Message - From: "Jim Downing" <[EMAI

Re: [Hibernate] DBCP Connection Pooling

2003-08-28 Thread Juozas Baliuka
Why do you need pooling if connections are time out. Close connection after transaction and open a new one before transaction without any kind of pooling. It must be very trivial to implement this kind of DataSource, a few lines of code. > > Ok, I am trying to get DBCP connection pooling working

Re: [Hibernate] DBCP Connection Pooling

2003-08-28 Thread Juozas Baliuka
> contradictory information about how to do this. > > > thanks, > > -dave > > > > > Juozas Baliuka wrote: > > Why do you need pooling if connections are time out. Close connection after > > transaction and open a new one before transaction without any kind

Re: [Hibernate] Postgresql array index exception creating a new record

2003-09-12 Thread Juozas Baliuka
Dissable batch updates, there is no batch updates in server protocol, driver just emulates this feature and it will not increase performance on postgresql at this time. > I think it is a bug in the Postgres implementation of JDBC batch updates. > > Gerry Duprey wrote: > > > Howdy, > > > > I'm n

Re: [Hibernate] Performance Problem - lots of many-to-one associations

2003-09-16 Thread Juozas Baliuka
I am not sure it can help for you, but sometimes I use this for "readonly" data : transform tables like "TBL_CITY" or "TBL_COUNTRY" to "properties" file and store this data on client side. > Using Hibernate 2.0.3 > > We have a table "panel_demographics" (xml at bottom) which holds foreign > ke

Re: [Hibernate] Problem

2003-09-17 Thread Juozas Baliuka
Have you tried to commit transaction ? - Original Message - From: "Prasad Iyer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 17, 2003 1:34 PM Subject: [Hibernate] Problem Hi, I am using Microsoft SQL Server as a database and Hibernate version 2.0.5 beta. We are

Re: [Hibernate] Problem

2003-09-18 Thread Juozas Baliuka
using Hibernate 2.0 beta 5 > > - Original Message - > From: "Juozas Baliuka" <[EMAIL PROTECTED]> > To: "Prasad Iyer" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Wednesday, September 17, 2003 9:13 PM > Subject: Re: [Hiberna

Re: [Hibernate] cglib reflect package

2003-09-26 Thread Juozas Baliuka
It has meaning for trivial methods "getters/setters" or "empty" constuctors. I am not sure, but looks like Sun JDK 1.4.1_02 generates code to optimize native method invokation too. - Original Message - From: "Bill Burke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 2

Re: [Hibernate] Re: cglib reflect package

2003-09-26 Thread Juozas Baliuka
It is possible to find problem outside generated code for optimization: setValues(bean,values); }catch( NullPointerException npe){ for( int i = 0; i < propertyCount; i++ ){ if( types[i].isPrimityve() && values[i] == null ){ throw new NullPointerException( "can not set null for

Re: [Hibernate] Hibernate Bug? [ConcurrentModificationException]

2003-09-27 Thread Juozas Baliuka
Yes, it is problem in SessionHolder implementation, but it is trivial to fix: > > 01:public class SessionHolder > 02:{ > 03: private static final boolean DEBUG = true; > 04: private static ThreadLocal session; > 05: > 06: public static Session getSession() > 07: { > 08:SessionHolder.conne

Re: [Hibernate] Hibernate Bug? [ConcurrentModificationException]

2003-09-28 Thread Juozas Baliuka
It must be bug in "SessionHolder". - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: "William R. Lorenz" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, September 27, 2003 1:48 PM Subject: Re: [Hibernate] Hibernate Bug? [ConcurrentModificatio

Re: [Hibernate] Caching cglib generated runtime proxies?

2003-09-29 Thread Juozas Baliuka
ate initializes. Looks like "debugLocaton" was dropped in cglib 1.0, it is possible to modify cglib or to remove optimizer, but it must be more trivial to dissable it (It is not very "drammatic" optimization). > > -Original Message- > From: Juozas Baliuka [m

Re: [Hibernate] Caching cglib generated runtime proxies?

2003-09-29 Thread Juozas Baliuka
There is system property in cglib "cglib.debugLocation" , if you will set it cglib will dump classes to this directory, but you will need to modify hibernate or cglib factories to use "Class.forName". - Original Message - From: "Mao, Dean (IHG)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>

Re: [Hibernate] BCEL/CGLIB dependencies...

2003-10-07 Thread Juozas Baliuka
cglib-1.0 "detects" BCEL or ASM using "Class.forName" and BCEL has priority. BCEL will be dropped in the next cglib releases and it will depend on ASM only. > Hi all, > > I saw some posts that suggested that instead of using BCEL and cglib, I > should use cglib-asm, which is a custom version of c

Re: [Hibernate] stored procedure and Hibernate ?

2003-10-12 Thread Juozas Baliuka
It must possible to map procedure this way : CREATE VIEW MyView AS ( ... call your procedures ... ) - Original Message - From: "bertrand lancelot" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 10, 2003 3:22 PM Subject: [Hibernate] stored procedure and Hibernate ?

Re: [Hibernate] [OT] bulk importing ideas

2003-10-15 Thread Juozas Baliuka
All of databases I have used have something like "LOAD, COPY ..." or stored procedures/API to import text files. Looks like it was C++ API in DB2 for import a few years ago, but I think you will find something more simple at this time, try to find some predefined stored procedure in documentation.

Re: [Hibernate] Re: CGLIB2

2003-10-27 Thread Juozas Baliuka
> > Ah. hm. I am actually ready to release 2.1rc1. Just waiting on > Bela's stuff. > > Exactly how beta is "beta"? We are going to change package name, but I do not think we will change something not trivial. > > >Gavin, with the API changes it's probably quickest if I put a patch > >toget

Re: [Hibernate] net.sf.dialect.BerkeleyDB: Hibernate without SQL?

2003-11-04 Thread Juozas Baliuka
- Original Message - From: "Adam Megacz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, November 04, 2003 12:40 PM Subject: [Hibernate] net.sf.dialect.BerkeleyDB: Hibernate without SQL? > > I've always felt that SQL is a poor match for object persistence; > something of an un

Re: [Hibernate] EHCache and JDK1.4

2003-11-15 Thread Juozas Baliuka
Fork and modify this class http://cvs.sourceforge.net/viewcvs.py/voruta/voruta/src/java/net/sf/voruta/S oftRefMemoryCache.java It is simple soft cache implementation and emulates LRU. BTW: Suns JVM SoftReference implements LRU algorythm itself . - Original Message - From: "Greg Luck" <

Re: [Hibernate] Urgent - Is this possible through hibernate??

2003-11-19 Thread Juozas Baliuka
You can do it in hebernate without JDBC. Implement stored procedure and use it this way: CREATE FUNCTION myProc() RETURNS INT . CREATE VIEW My_Update( ID, update_count ) as SELECT 'myConstant' , myProc(); Map this view to readonly object. - Original Message - From: "Vivian Fon

Re: [Hibernate] Query Counter Interceptor?

2003-11-24 Thread Juozas Baliuka
http://www.p6spy.com/ Try to query system views for statistics, it must help for performance tuning too. - Original Message - From: "Eric Pugh" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 24, 2003 11:30 AM Subject: [Hibernate] Query Counter Interceptor? > Hi all,

Re: [Hibernate] in-memory databases vs query-in-memory databases

2003-11-27 Thread Juozas Baliuka
- Original Message - From: "Adam Megacz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 27, 2003 4:46 AM Subject: [Hibernate] in-memory databases vs query-in-memory databases > > Okay, this isn't 100% hibernate-related, but I figure you guys think a > lot about stuf

Re: [Hibernate] in-memory databases vs query-in-memory databases

2003-11-27 Thread Juozas Baliuka
re orders in stock exhange ). If you are talking about applications like "Web blog", Prevayler must be a good choise. > > "Juozas Baliuka" <[EMAIL PROTECTED]> writes: > > Databases lock updated and deleted rows only and transaction blocks > > on conf

Re: [Hibernate] in-memory databases vs query-in-memory databases

2003-11-29 Thread Juozas Baliuka
- Original Message - From: "Adam Megacz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 29, 2003 3:04 AM Subject: Re: [Hibernate] in-memory databases vs query-in-memory databases > > "Juozas Baliuka" <[EMAIL PROTECTED]

Re: [Hibernate] Versioning Jar Files?

2003-12-18 Thread Juozas Baliuka
Maven is a good idea, but not a good as implementation. It is very good for generated reports in undocumented projects like cglib :) I can understand it, Maven depends almost on evrything you can find on inet and it is very hard to release product with this count of dependancies. It took a lot of