Jody Garnett ha scritto: >> Jody: >> I think we should start some discussions about transaction handling. >> Do you know this article >> http://static.springframework.org/spring/docs/2.5.5/reference/transaction.ht >> ml >> Btw, GeoServer uses Spring, GeoServer should do the transaction handling, >> not geotools (you know my opinion) >> > I share your opinion; but you are going to have to do some work to > "teach" GeoTools how to interact with the external application. (ie > design a solution and present it as a proposal). The existing interfaces > are not going to meet your needs.
Jody, read your mail and I'm wondering if Christian really needs all of what you're proposing. To "jsut" work in typical J2EE enviroment where you only have databases around, no files, no remote servers, I believe there would be no need for a repository concept, but just a Transaction class that can participate in the declarative transaction set up. What you're describing woudl be a transaction against different backends, a distributed one, which would need specific support for two phase commit in file and remote server based resources, something I believe cannot even be done using, for example WFS-T, and might be hard to implement with other backends. There is a relatively common sweet spot where you use GeoTools stuff along with other non GIS pieces of code, and you want them to operate under the same container managed transaction (or Spring managed). In these cases, the "container" (be it J2EE or Spring) knows when to open a transaction and a connection, puts them in some shared context (thread local for Spring) and provides methods you should use to work within that transaction. You never call commit, the container does. In the case of Spring declarative transaction handling for example, you declare an interface to be a transactional service, a dynamic proxy is created that opens the connection and the transaction on entry, and then commits and closes when you exit the service method, or rollbacks and closes when an exception is thrown. For this I believe we would just need a new kind of Transaction class and some allowance in the existing jdbc datastores so that they don't try to create their own connection, but leverage the one provided by the container and put in the special transaction. That requires some changes, since the current datastores pretend a datasource we cannot give them anymore in a container managed environment, but it seems quite doable to me. It just need a well thought out proposal and resources to implement it. Cheers Andrea ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
