hi folks,
these days I was having problems with my CDO server:
after inserting some models into a repository, and then restarting the server, I was getting this error:
[ERROR] Rollback in DBStore: org.eclipse.net4j.db.DBException: SQL Exception: A lock could not be obtained within the time requested
First, I thought, I forgot to commit/close a transaction; but this was not the case.
In the emf news group, eike told me, that there was a similar problem in the tests based on apache derby.
So, I switched to H2, and the error did not occur anymore.
I was desperately looking for the net4j H2Adapter in the latest net4j releases but was not able to find it. Finally, I found it here, copied to my workspace, and changed the creation of the IStore:
org.h2.jdbcx.JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setURL("jdbc:h2:~/h2Test");
IDBAdapter dbAdapter = new H2Adapter();
IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true);
IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
IStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
cheers,
steven
Freitag, 17. Juli 2009
Freitag, 15. Mai 2009
Eclipse CDO Example
hi folks,
I found an example application for Eclipse CDO. And I describe how to get it running.
Download the latest Eclipse Modeling Tools: from Eclipse download choose Development Builds to get the latest tools. Fortunately, the site lets you know, that there are some problems for mac users with the 3.5M7 release. One problem is that there is no 'dropins' folder; but I will show you how we can bypass this problem (creating a folder named 'dropins' does not work :( ). Go get the Modeling tools!
Additionally you need: the latest builds of CDO vers. 2.x (not 1.09!), Net4J vers. 2.x (not 1.09!), and Teneo.
Download them, create a folder 'CDO_runtime' and copy all plugins found in the CDO, Net4j and Teneo builds into this folder. Next, save the Team Project Set file as 'cdo_example.psf'
Now, start Eclipse of your Modeling Tools. In the Package Explorer right click->Import... ->Team->Team Project Set and choose 'cdo_example.psf'.
The next step is to add the cdo, net4j and teneo plugins to the Eclipse runtime. Normally, you do that by throwing them into Eclipse's 'dropin' folder which is absent in the current os x build. Therefore, we create a new Target Definition. Choose one of the CDO example projects, press CMD+N, choose Plug-in Development->Target Definition and name the file 'cdo_target'. Open the created 'cdo_target.target' file. In the upcoming editor press Add..., choose Installation->Next, type '${eclipse_home}' as location and press Finish. Now, we add our 'CDO_runtime' folder as location; so again press Add..., then choose Directory->Next, browse to this folder and press Finish. Finally, press Set as Target Platform in the upper right of the editor. At this point, all required plugins for the CDO example are installed.
If you want to change your target platform back to the original Eclipse installation, open the preferences (CMD+,), choose Plug-in Development->Target Platform and select Running Platform.
I did not have the time to play around with the example .. the installation took sooo long ;).
I will post after further investigations have been done.
Happy experimenting with CDO!
greetzn,
steven
I found an example application for Eclipse CDO. And I describe how to get it running.
Download the latest Eclipse Modeling Tools: from Eclipse download choose Development Builds to get the latest tools. Fortunately, the site lets you know, that there are some problems for mac users with the 3.5M7 release. One problem is that there is no 'dropins' folder; but I will show you how we can bypass this problem (creating a folder named 'dropins' does not work :( ). Go get the Modeling tools!
Additionally you need: the latest builds of CDO vers. 2.x (not 1.09!), Net4J vers. 2.x (not 1.09!), and Teneo.
Download them, create a folder 'CDO_runtime' and copy all plugins found in the CDO, Net4j and Teneo builds into this folder. Next, save the Team Project Set file as 'cdo_example.psf'
Now, start Eclipse of your Modeling Tools. In the Package Explorer right click->Import... ->Team->Team Project Set and choose 'cdo_example.psf'.
The next step is to add the cdo, net4j and teneo plugins to the Eclipse runtime. Normally, you do that by throwing them into Eclipse's 'dropin' folder which is absent in the current os x build. Therefore, we create a new Target Definition. Choose one of the CDO example projects, press CMD+N, choose Plug-in Development->Target Definition and name the file 'cdo_target'. Open the created 'cdo_target.target' file. In the upcoming editor press Add..., choose Installation->Next, type '${eclipse_home}' as location and press Finish. Now, we add our 'CDO_runtime' folder as location; so again press Add..., then choose Directory->Next, browse to this folder and press Finish. Finally, press Set as Target Platform in the upper right of the editor. At this point, all required plugins for the CDO example are installed.
If you want to change your target platform back to the original Eclipse installation, open the preferences (CMD+,), choose Plug-in Development->Target Platform and select Running Platform.
I did not have the time to play around with the example .. the installation took sooo long ;).
I will post after further investigations have been done.
Happy experimenting with CDO!
greetzn,
steven
Mittwoch, 21. Januar 2009
Your generator knows it!
Currently I am working on a Java-to-.Net-Compiler. In addition to using
ANTLR and Micosoft's Phoenix framework I have to write a lot of C# code that lends itself to be generated.
Besides the need for a java grammar, which can be found here, we need an AST (Abstract Syntax Tree) to accomplish the semantic analysis. ANTLR offers an AST construction mechanism and generates an AST walker from a tree grammar. Basically the semantic analysis can be done solely with ANTLR. But, we are facing the challenge that each teammate needs to work with the AST and not everyone knows ANTLR. Thus we need an ANTLR independent AST.
The basis of our Java AST is the Eclipse JDT AST. My task is to implement the AST using C#. So, to implement means to copy since the JDT AST seems be a good model.
Did I say model? This sounds like feeding the JDT AST code into a code generator and letting the generator create the C# implementation.
Consequently we create a generator using openArchitectureWare that will take an UML2 class model, yes we decided to create an UML model of the AST ;), and generate C# classes.
I sat down with a teammate having C# experiences to create the generator templates for generating C# code.
Perfect! Now, our generator knows how to create C# classes .. and my teammate can go home :D. Furthermore we generate the basic visitor code for the AST from its model.
By the way .. a language grammar lends itself to automatic AST generation .. check out this paper.
Generators are knowledge containers!
steven
ANTLR and Micosoft's Phoenix framework I have to write a lot of C# code that lends itself to be generated.
Besides the need for a java grammar, which can be found here, we need an AST (Abstract Syntax Tree) to accomplish the semantic analysis. ANTLR offers an AST construction mechanism and generates an AST walker from a tree grammar. Basically the semantic analysis can be done solely with ANTLR. But, we are facing the challenge that each teammate needs to work with the AST and not everyone knows ANTLR. Thus we need an ANTLR independent AST.
The basis of our Java AST is the Eclipse JDT AST. My task is to implement the AST using C#. So, to implement means to copy since the JDT AST seems be a good model.
Did I say model? This sounds like feeding the JDT AST code into a code generator and letting the generator create the C# implementation.
Consequently we create a generator using openArchitectureWare that will take an UML2 class model, yes we decided to create an UML model of the AST ;), and generate C# classes.
I sat down with a teammate having C# experiences to create the generator templates for generating C# code.
Perfect! Now, our generator knows how to create C# classes .. and my teammate can go home :D. Furthermore we generate the basic visitor code for the AST from its model.
By the way .. a language grammar lends itself to automatic AST generation .. check out this paper.
Generators are knowledge containers!
steven
Labels:
AST construction,
code generators
Mittwoch, 6. August 2008
new oaw refactoring features
hello folks,
here are news from the oaw code frontier. I finished implementing the move extension and rename resource feature. the move extension feature was trickier than I thought .. you not only have to delete the extension from the source file and insert it into the target file, you have to check which namespace and extensions are required to get the moved extension running within the target xtend file and you have to determine where to insert each import. I had a lot of MalformedTreeExceptions meaning that the insertions of new imports overlap or the inserted extension is not inside the document range :@!
the tricky part of the calculation of the import offsets, the positions each import shall be inserted at, is the differentiation of different cases: is the target file empty, does it contain imports only, does it contain imports and extensions .. my code was covered with ugly nested, not understandable if-statements. to come up with this mess, I used the Strategy Pattern. the gof book says that it should be applied, if "different algorithms will be appropriate at different times". my base strategy class handles the common operations for the movement of an extension: remove the extension from the source file, update imports in all other files etc. it contains an abstract method called "createTargetFileChanges", which has to be overridden by subclasses implementing a different insertion strategy. according to the target file's state, an appropriate strategy is chosen. the code is much clearer now and new cases can be handled (added) easier.
A screencast showing the implemented features in action can be found here (.avi, 24.2 mb). the ui looks a little bit inconsistent and unhandy .. this is my next implementation step.
I could not work that much the last days, since I got my admission for the master program at the hasso-plattner-institute for software systems engineering (YESSSS!) and I had to do a lot of administrative stuff .. get rid of my old flat, leave my old university.
I planned to submit a paper about the modeling tool and distributed model simulation environment for information retrieval processes developed during my bachelor thesis to the mdsd today conference, but due to the upcoming gsoc deadline I will not have the time for writing one :(.
So, during the next days I will focus my implementation efforts on the ui aspects of the oaw refactoring feature and finally I will test it using a real life oaw project.
stay tuned!
steven
here are news from the oaw code frontier. I finished implementing the move extension and rename resource feature. the move extension feature was trickier than I thought .. you not only have to delete the extension from the source file and insert it into the target file, you have to check which namespace and extensions are required to get the moved extension running within the target xtend file and you have to determine where to insert each import. I had a lot of MalformedTreeExceptions meaning that the insertions of new imports overlap or the inserted extension is not inside the document range :@!
the tricky part of the calculation of the import offsets, the positions each import shall be inserted at, is the differentiation of different cases: is the target file empty, does it contain imports only, does it contain imports and extensions .. my code was covered with ugly nested, not understandable if-statements. to come up with this mess, I used the Strategy Pattern. the gof book says that it should be applied, if "different algorithms will be appropriate at different times". my base strategy class handles the common operations for the movement of an extension: remove the extension from the source file, update imports in all other files etc. it contains an abstract method called "createTargetFileChanges", which has to be overridden by subclasses implementing a different insertion strategy. according to the target file's state, an appropriate strategy is chosen. the code is much clearer now and new cases can be handled (added) easier.
A screencast showing the implemented features in action can be found here (.avi, 24.2 mb). the ui looks a little bit inconsistent and unhandy .. this is my next implementation step.
I could not work that much the last days, since I got my admission for the master program at the hasso-plattner-institute for software systems engineering (YESSSS!) and I had to do a lot of administrative stuff .. get rid of my old flat, leave my old university.
I planned to submit a paper about the modeling tool and distributed model simulation environment for information retrieval processes developed during my bachelor thesis to the mdsd today conference, but due to the upcoming gsoc deadline I will not have the time for writing one :(.
So, during the next days I will focus my implementation efforts on the ui aspects of the oaw refactoring feature and finally I will test it using a real life oaw project.
stay tuned!
steven
Donnerstag, 24. Juli 2008
Google Summer of Code (GSoC) 2008
Recently I am taking part in the GSoC. My job is to implement a refacoring feature for the MDA/MDD generator framework openArchitectureWare.
As you can see at the project's wiki site, I am almost finished implementing the required features.
I implemented a protoypic eclipse integration using the Language Toolkit (LTK) first. This was (and still is :)) a prototype, since I wanted to focus my efforts on the algorithms the whole refactoring is based on. The UI sugar comes later ;).
The implementation was easier than I thought. I became aquainted with the oAW source quickly, although it is commented very very raley :D. Very helpful were the Eclipse Type Hierarchy and Call Hierarchy. The Call Hierarchy is your perfect buddy for figuring out, how an API works.
A screencast showing the refactorings Rename Extension and Rename DEFINE can be found here (.flv 22.6 mb). Note that it is in german .. it was not meant to be published .. just a little status report for my gsoc mentor peter .. but if you cannot wait to see the refacorings in action, go for it! I will publish another screen cast with even more cool features the coming days.
I planned to finish the implementation of the refactoring algorithms by the end of this week.
Right now I am working on the Move Extension feature.
If this feature is implemented, I will take some days to clean up the code and make the abstractions clearer. Then I will start working on the user experience .. precondition checking, meaningful dialogs etc.
As you can see at the project's wiki site, I am almost finished implementing the required features.
I implemented a protoypic eclipse integration using the Language Toolkit (LTK) first. This was (and still is :)) a prototype, since I wanted to focus my efforts on the algorithms the whole refactoring is based on. The UI sugar comes later ;).
The implementation was easier than I thought. I became aquainted with the oAW source quickly, although it is commented very very raley :D. Very helpful were the Eclipse Type Hierarchy and Call Hierarchy. The Call Hierarchy is your perfect buddy for figuring out, how an API works.
A screencast showing the refactorings Rename Extension and Rename DEFINE can be found here (.flv 22.6 mb). Note that it is in german .. it was not meant to be published .. just a little status report for my gsoc mentor peter .. but if you cannot wait to see the refacorings in action, go for it! I will publish another screen cast with even more cool features the coming days.
I planned to finish the implementation of the refactoring algorithms by the end of this week.
Right now I am working on the Move Extension feature.
If this feature is implemented, I will take some days to clean up the code and make the abstractions clearer. Then I will start working on the user experience .. precondition checking, meaningful dialogs etc.
Labels:
eclipse,
google summer of code,
GSoC,
ltk
Abonnieren
Posts (Atom)