I'm sorry the OracleDatastore is not maintained by anyone, I'have noticed that, 
at least in gt 2.1 (the version I'm currently using, I've not found enough time 
to migrate to the current version...) the quality is not like other modules and 
plugin. I'm thinking to migrate to postgis (I like more it because is 
opensource), but a lot of other information related to other application (like 
the one of population) are on an oracle database... 


As requested by Jody I'll try to explain the reason on my question. 

I have to create a database with documents with
- a geometry 
- a number of "normal" attributes
- a number of "many to many" associations with some other tables (i.e. 1 or 
more codes from a number of "code-description" tables

In terms of database I have the main table (in which I have the geometry and 
"normal" attributes), a number of "code-description" tables, and a number of 
association tables. I have to be sure that operations on main table and 
association tables are performed under the same transaction, to have the 
database always in a consistent state.

I have arranged as explained in my previous mail, so for my project I think 
that I have a workaround thank to all again for the help


-----Messaggio originale-----
Da: Jody Garnett [mailto:[EMAIL PROTECTED] 
Inviato: mercoledì 18 aprile 2007 21.35
A: Alessandro Radaelli
Cc: [email protected]; Federico Nieri
Oggetto: Re: [Geotools-gt2-users] R: Geotools and database transactions

Currently the oracle datastore is not maintained by anyone (so nobody 
has answered your question).

Yes it would be possible to modify getConnection(), out of curiosity 
what additonal jdbc operations do you need to perform? At least one 
person who encountered this problem made a sql("") function which would 
issue SQL on the internal connection.

Jody
Alessandro Radaelli wrote:
> Applying the solution proposed by Andrea I noticed that the method 
> getConnection is protected, so it is not visible by my code. As a workaround 
> I'm going to extend OracleDatastore (and factory) creating a new method with 
> public visibility, but according to me it is not the final solution, because 
> I am forced to extend OracleDatastore when I have to connect to an oracle 
> database, or PostGisDatastore when I have to connect to a PostGis. It is 
> useless to create a new class extending JDBCDatastore (OracleDatastore and 
> PostgisDatastore does not extend the new class, so the new method will not be 
> present...)
>
> It it possible to modify the visibility of getConnection? Is it possible to 
> have a JDBCDatastore constructor that use a connection previously created  
> instead of a connection pool?
>
>
>
> -----Messaggio originale-----
> Da: Andrea Aime [mailto:[EMAIL PROTECTED] 
> Inviato: martedì 17 aprile 2007 14.47
> A: Alessandro Radaelli
> Cc: [email protected]; Federico Nieri
> Oggetto: Re: [Geotools-gt2-users] Geotools and database transactions
>
> Alessandro Radaelli ha scritto:
>   
>> I think that geotools is a very powerful library and I want to 
>> congratulate with all the developers.
>>
>>  
>>
>> We are developing an application that have to  
>>
>> 1 - insert a new feature in a geotools datastore (actually an 
>> OracleDatastore). We are going to use geotools to accomplish this task
>>
>> 2 - insert some records  in a lot of other db tables (in the same Oracle 
>> schema). We are going to use jdbc to accomplish this task
>>
>>  
>>
>> We need to issue both operations  under the same transaction. How can we 
>> do? Is there any example?
>>     
>
> No examples, but you can do the following:
> * create a new DefaultTransaction
> * call getConnection(transaction) from the JDBC data store you're using
> * use the connection to do whatever jdbc operations you need
> * use the same gt2 transaction in feature operations
> * commit the gt2 transaction
> * close the gt2 transaction
>
> Oh, don't close the connection you get at the second point, geotools
> will do it when you do close the gt2 transaction.
>
> Hope this helps
>
> Cheers
> Andrea
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to