RE: Isolation level

2008-03-05 Thread Christian Lipp
Thank you Armin!

I am using DB2 and I failed to use something like "jdbc.TransactionLevel"
nor could I find anything on the docs for DB2.
So I am going to implement it, as long as anyone on this list know a setting
for DB2?

Thanks, CL


-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Mittwoch, 20. Februar 2008 14:47
To: OJB Users List
Subject: Re: Isolation level

Hi Christian,

Christian Lipp wrote:
> Hi Armin,
> 
> thank you for  quick answer and sorry for my long delay.
> 
> We are using an older OJB version (1.0.1.x), so I thought I cannot use 
> your recommendation and wanted to perform a backport now.
> I got the actual OJB now and examined it, but also couldn't find an 
> attribute in the jdbc-connection-descriptor (I checked the
repository.dtd).
> 
> So I asume I have to implement the JDBC transaction level as attribute 
> for jdbc-connection-descriptor into OJB or do I miss something?

Some databases support transaction-isolation settings by append a property
in the database URL - e.g. maxDB:
dbalias="//localhost/ojb?isolation=TRANSACTION_READ_COMMITTED

Additionally you can specify connection/database properties as custom
attributes with prefix "jdbc.".


 


OJB will set these properties (with jdbc.* prefix) when create the
connection:
Connection con = DriverManager.getConnection(url, properties);


> 
> Could someone point me in the right direction for this implementation? I
> assume I have to read the attribute and apply it in the function
> PlatformDefaultImpl.initializeJdbcConnection.
>

If your database doesn't support isolation setting shown above, you can 
indeed extend a existing Platform class and override 
#initializeJdbcConnection. Within this method you can easily get custom 
attributes using:





class PlatformMyOwnImpl extends PlatformMySQLImpl{
...
public void initializeJdbcConnection(Connection conn)
{
   String isolation = jcd.getAttribute("isolation", null);
...
}
}

All shown solutions will work with latest OJB source
http://www.mail-archive.com/ojb-user%40db.apache.org/msg16078.html
I don't check the older versions.

regards,
Armin

> Thanks in advance, CL
> 
> -Original Message-
> From: Armin Waibel [mailto:[EMAIL PROTECTED] 
> Sent: Freitag, 25. Jänner 2008 03:03
> To: OJB Users List
> Subject: Re: Isolation level
> 
> Hi Christian,
> 
> Christian Lipp wrote:
>> I am still looking for an solution for my lock level settings and 
>> therefore I am digging through the OJB source.
>>
>> What I am not sure at the moment is if the setting of the 
>> isolation-level is generally ignored in OJB?
>> 
>>
>> I couldn't find the place in the OJB code where the isolation level is 
>> set to the DescriptorRepository and later to the connection.
>> In my optionion the isolation-level in the XML file is ignored.
>>
>> Could someone point me in the right direction?
> 
> Out of the box the isolation-level setting is only used by the ODMG-api
> which use pessimistic locking by default.
> http://db.apache.org/ojb/docu/guides/lockmanager.html#Pessimistic-Locking
> The PB-api doesn't use pessimistic locking, thus it will ignore these
> settings.
> 
> The database transaction levels are completely independent from the
> isolation-level setting in OJB. So you can use different database
> transaction levels (e.g. as property in the dbalias attribute in the
> jdbc-connection-descriptor)
> 
> regards,
> Armin
> 
>> Thanks in advance,
>> CL
>>
>>
>>
>>
>> -
>> 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]
> 
> 
> 
> -
> 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]



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



Re: Isolation level

2008-02-20 Thread Armin Waibel

Hi Christian,

Christian Lipp wrote:

Hi Armin,

thank you for  quick answer and sorry for my long delay.

We are using an older OJB version (1.0.1.x), so I thought I cannot use your
recommendation and wanted to perform a backport now.
I got the actual OJB now and examined it, but also couldn't find an
attribute in the jdbc-connection-descriptor (I checked the repository.dtd).

So I asume I have to implement the JDBC transaction level as attribute for
jdbc-connection-descriptor into OJB or do I miss something?


Some databases support transaction-isolation settings by append a
property in the database URL - e.g. maxDB:
dbalias="//localhost/ojb?isolation=TRANSACTION_READ_COMMITTED

Additionally you can specify connection/database properties as custom 
attributes with prefix "jdbc.".






OJB will set these properties (with jdbc.* prefix) when create the 
connection:

Connection con = DriverManager.getConnection(url, properties);




Could someone point me in the right direction for this implementation? I
assume I have to read the attribute and apply it in the function
PlatformDefaultImpl.initializeJdbcConnection.



If your database doesn't support isolation setting shown above, you can 
indeed extend a existing Platform class and override 
#initializeJdbcConnection. Within this method you can easily get custom 
attributes using:



   


class PlatformMyOwnImpl extends PlatformMySQLImpl{
...
public void initializeJdbcConnection(Connection conn)
{
  String isolation = jcd.getAttribute("isolation", null);
...
}
}

All shown solutions will work with latest OJB source
http://www.mail-archive.com/ojb-user%40db.apache.org/msg16078.html
I don't check the older versions.

regards,
Armin


Thanks in advance, CL

-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Freitag, 25. Jänner 2008 03:03

To: OJB Users List
Subject: Re: Isolation level

Hi Christian,

Christian Lipp wrote:
I am still looking for an solution for my lock level settings and 
therefore I am digging through the OJB source.


What I am not sure at the moment is if the setting of the 
isolation-level is generally ignored in OJB?



I couldn't find the place in the OJB code where the isolation level is 
set to the DescriptorRepository and later to the connection.

In my optionion the isolation-level in the XML file is ignored.

Could someone point me in the right direction?


Out of the box the isolation-level setting is only used by the ODMG-api
which use pessimistic locking by default.
http://db.apache.org/ojb/docu/guides/lockmanager.html#Pessimistic-Locking
The PB-api doesn't use pessimistic locking, thus it will ignore these
settings.

The database transaction levels are completely independent from the
isolation-level setting in OJB. So you can use different database
transaction levels (e.g. as property in the dbalias attribute in the
jdbc-connection-descriptor)

regards,
Armin


Thanks in advance,
CL




-
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]



-
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]



RE: Isolation level

2008-02-19 Thread Christian Lipp
Hi Armin,

thank you for  quick answer and sorry for my long delay.

We are using an older OJB version (1.0.1.x), so I thought I cannot use your
recommendation and wanted to perform a backport now.
I got the actual OJB now and examined it, but also couldn't find an
attribute in the jdbc-connection-descriptor (I checked the repository.dtd).

So I asume I have to implement the JDBC transaction level as attribute for
jdbc-connection-descriptor into OJB or do I miss something?

Could someone point me in the right direction for this implementation? I
assume I have to read the attribute and apply it in the function
PlatformDefaultImpl.initializeJdbcConnection.

Thanks in advance, CL

-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Freitag, 25. Jänner 2008 03:03
To: OJB Users List
Subject: Re: Isolation level

Hi Christian,

Christian Lipp wrote:
> I am still looking for an solution for my lock level settings and 
> therefore I am digging through the OJB source.
> 
> What I am not sure at the moment is if the setting of the 
> isolation-level is generally ignored in OJB?
> 
> 
> I couldn't find the place in the OJB code where the isolation level is 
> set to the DescriptorRepository and later to the connection.
> In my optionion the isolation-level in the XML file is ignored.
> 
> Could someone point me in the right direction?

Out of the box the isolation-level setting is only used by the ODMG-api
which use pessimistic locking by default.
http://db.apache.org/ojb/docu/guides/lockmanager.html#Pessimistic-Locking
The PB-api doesn't use pessimistic locking, thus it will ignore these
settings.

The database transaction levels are completely independent from the
isolation-level setting in OJB. So you can use different database
transaction levels (e.g. as property in the dbalias attribute in the
jdbc-connection-descriptor)

regards,
Armin

> 
> Thanks in advance,
> CL
> 
> 
> 
> 
> -
> 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]



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



Re: Isolation level

2008-01-24 Thread Armin Waibel

Hi Christian,

Christian Lipp wrote:

I am still looking for an solution for my lock level settings and therefore
I am digging through the OJB source.

What I am not sure at the moment is if the setting of the isolation-level is
generally ignored in OJB?


I couldn't find the place in the OJB code where the isolation level is set
to the DescriptorRepository and later to the connection.
In my optionion the isolation-level in the XML file is ignored.

Could someone point me in the right direction?


Out of the box the isolation-level setting is only used by the ODMG-api 
which use pessimistic locking by default.

http://db.apache.org/ojb/docu/guides/lockmanager.html#Pessimistic-Locking
The PB-api doesn't use pessimistic locking, thus it will ignore these 
settings.


The database transaction levels are completely independent from the 
isolation-level setting in OJB. So you can use different database 
transaction levels (e.g. as property in the dbalias attribute in the 
jdbc-connection-descriptor)


regards,
Armin



Thanks in advance,
CL




-
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]



RE: Isolation level for Persistence broker queries

2005-01-03 Thread Vesely, Max [IT]
Thank you. 

What I was trying to do, actually, was to change default isolation level to 
lesser level of read-uncommitted for some of my selects. I replaced OJB SQL 
generator to append database engine (DB2) specific clause (WITH UR) in my SQL 
command to achieve that.

Max.



 -Original Message-
From:   CLARAMONTE Jean-Baptiste [mailto:[EMAIL PROTECTED] 
Sent:   Monday, January 03, 2005 4:38 AM
To: Vesely, Max [IT]; 'OJB Users List '
Subject:    RE: Isolation level for Persistence broker queries

 Hello,

With the PersistenceBroker api you can't specify the isolation level. You
can use optimistic transaction to enhance the consistency of your data but
you should be very cautious if you use it with a cache because it can
introduce some strange behaviour on data highly exposed to concurrency
update !

-Message d'origine-
De: Vesely, Max [IT]
A: OJB Users List
Date: 31/12/2004 01:12
Objet: RE: Isolation level for Persistence broker queries

Thanks. I'll wait for the next week then.

Max.

 -Original Message-
From:   Thomas Dudziak [mailto:[EMAIL PROTECTED] 
Sent:   Thursday, December 30, 2004 7:04 PM
To: OJB Users List
Subject:    Re: Isolation level for Persistence broker queries

Vesely, Max [IT] wrote:

>Is there a particular reason I don't get my questions answered? Just to
know it will save me some time in the future.
>  
>
Well, I would say it is because currently there are holidays, so you can

only reasonably expect answers next week the earliest, I'd say. And the 
people that every once in a while check their mail (like myself) are 
likely not able to answer your question. I for one don't know much about

the isolation level stuff so I can't help you there.

Tom


-
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]
*** We scanned this email for malicious content ***
*** IMPORTANT: Do not open attachments from unrecognized senders  ***
*** MailSystem ASTON ***



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



RE: Isolation level for Persistence broker queries

2005-01-03 Thread CLARAMONTE Jean-Baptiste
  Hello,

With the PersistenceBroker api you can't specify the isolation level. You
can use optimistic transaction to enhance the consistency of your data but
you should be very cautious if you use it with a cache because it can
introduce some strange behaviour on data highly exposed to concurrency
update !

-Message d'origine-
De: Vesely, Max [IT]
A: OJB Users List
Date: 31/12/2004 01:12
Objet: RE: Isolation level for Persistence broker queries

Thanks. I'll wait for the next week then.

Max.

 -Original Message-
From:   Thomas Dudziak [mailto:[EMAIL PROTECTED] 
Sent:   Thursday, December 30, 2004 7:04 PM
To: OJB Users List
Subject:    Re: Isolation level for Persistence broker queries

Vesely, Max [IT] wrote:

>Is there a particular reason I don't get my questions answered? Just to
know it will save me some time in the future.
>  
>
Well, I would say it is because currently there are holidays, so you can

only reasonably expect answers next week the earliest, I'd say. And the 
people that every once in a while check their mail (like myself) are 
likely not able to answer your question. I for one don't know much about

the isolation level stuff so I can't help you there.

Tom


-
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]
*** We scanned this email for malicious content ***
*** IMPORTANT: Do not open attachments from unrecognized senders  ***
*** MailSystem ASTON ***

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



RE: Isolation level for Persistence broker queries

2004-12-30 Thread Vesely, Max [IT]
Thanks. I'll wait for the next week then.

Max.

 -Original Message-
From:   Thomas Dudziak [mailto:[EMAIL PROTECTED] 
Sent:   Thursday, December 30, 2004 7:04 PM
To: OJB Users List
Subject:        Re: Isolation level for Persistence broker queries

Vesely, Max [IT] wrote:

>Is there a particular reason I don't get my questions answered? Just to know 
>it will save me some time in the future.
>  
>
Well, I would say it is because currently there are holidays, so you can 
only reasonably expect answers next week the earliest, I'd say. And the 
people that every once in a while check their mail (like myself) are 
likely not able to answer your question. I for one don't know much about 
the isolation level stuff so I can't help you there.

Tom


-
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]



Re: Isolation level for Persistence broker queries

2004-12-30 Thread Thomas Dudziak
Vesely, Max [IT] wrote:
Is there a particular reason I don't get my questions answered? Just to know it will save me some time in the future.
 

Well, I would say it is because currently there are holidays, so you can 
only reasonably expect answers next week the earliest, I'd say. And the 
people that every once in a while check their mail (like myself) are 
likely not able to answer your question. I for one don't know much about 
the isolation level stuff so I can't help you there.

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


RE: Isolation level for Persistence broker queries

2004-12-30 Thread Vesely, Max [IT]
Is there a particular reason I don't get my questions answered? Just to know it 
will save me some time in the future.

Thanks.



 -Original Message-
From:   Vesely, Max [IT]  
Sent:   Wednesday, December 29, 2004 5:48 PM
To: ojb-user@db.apache.org
Subject:Isolation level for Persistence broker queries

Hello,

Is there any way to specify isolation level for OJB query executed using 
Persistence Broker API? I can see that there's isolation-level attribute 
available for class-descriptor but documentation says it's only used in ODMG 
implementation.

Any help would be greatly appreciated.

Max.

-
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]



Re: isolation-level: null

2003-09-21 Thread joss . wright

Hinnerk,

I think this is a problem with the XML parser rather than the web container. I have 
had similar problems with different versions of Tomcat.

I think it's down to the parser not being able to interpret spaces in the file path of 
the repository.dtd, repository_database.xml, repository_internal.xml, 
repository_user.xml files etc.

I resolved the problem by changing to DOCTYPE tag to:

 

and copying and pasting the contents of the entity files into the repository.xml file, 
i.e. the repository.xml file contains repository_database.xml, 
repository_internal.xml, repository_user.xml etc.

I notice that OJB 1.0.rc4 has a slightly different DOCTYPE tag to rc3, it is similar 
to above so repository.dtd problem might have been resolved but I think you'll still 
have problems with the entity files.

Hope this helps,

Joss
> Hello,
>
>I'm using OJB for a struts- project, and tried to migrate it to
>another server; e.g. from a PC running resin as jsp- server to another
>PC running the same version of resin, struts etc. I tried my best to
>copy the necessary java- archives, but I'm getting the following
>exception. Tried "everything" to debug it, changed the repository.xml
>to track the error, but unfortunatly this didn't help; do you have a
>hint for me? That would be great!
>
>I will attach my repository.xml and the error- log with debugging-
>information in a zip- file.
>
>Thank you,
>Hinnerk
>
>and here follows the error:
>
>java.lang.ExceptionInInitializerError
>at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultKey(PersistenceBrokerFactoryDefaultImpl.java:150)
>at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(PersistenceBrokerFactoryDefaultImpl.java:121)
>at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>at java.lang.Class.newInstance0(Class.java:306)
>at java.lang.Class.newInstance(Class.java:259)
>at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(PersistenceBrokerFactoryFactory.java:95)
>at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(PersistenceBrokerFactoryFactory.java:71)
>at 
> org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(PersistenceBrokerFactory.java:129)
>at org.rolli.user.UserManager.init(UserManager.java:51)
>at javax.servlet.GenericServlet.init(GenericServlet.java:258
>(...)
>at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
>Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not read 
>repository class descriptor data, using repository: repository.xml: Exception when 
>reading metadata information, please check your repository.xml file
>at 
> org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:133)
>at 
> org.apache.ojb.broker.metadata.MetadataManager.(MetadataManager.java:119)
>at 
> org.apache.ojb.broker.metadata.MetadataManager.(MetadataManager.java:109)
>... 24 more
>Caused by: org.apache.ojb.broker.metadata.MetadataException: Exception when reading 
>metadata information, please check your repository.xml file
>at 
> org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(RepositoryXmlHandler.java:764)
>at com.caucho.xml.XmlParser.addElement(XmlParser.java:2249)
>at com.caucho.xml.XmlParser.parseElement(XmlParser.java:615)
>at com.caucho.xml.XmlParser.parseNode(XmlParser.java:364)
>at com.caucho.xml.XmlParser.parseInt(XmlParser.java:246)
>at com.caucho.xml.AbstractParser.parse(AbstractParser.java:614)
>at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(RepositoryPersistor.java:343)
>at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(RepositoryPersistor.java:300)
>at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(RepositoryPersistor.java:215)
>at 
> org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:129)
>... 26 more
>Caused by: java.lang.NullPointerException
>at 
> org.apache.ojb.broker.metadata.RepositoryXmlHandler.getIsoLevel(RepositoryXmlHandler.java:946)
>at 
> org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(RepositoryXmlHandler.java:216)
>... 35 more
>
>---
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




talk21 your FREE portable and private address on the net at http://www.talk21.com


--