25 Ocak 2014 Cumartesi

the error: "org.neo4j.graphdb.NotInTransactionException"

The error message is somehing like this:

2014-01-25 16:37:43 ERROR HPAggregateProfile:141 - GRAMY_ERR:
org.neo4j.graphdb.NotInTransactionException
at org.neo4j.kernel.impl.index.IndexConnectionBroker.acquireResourceConnection(IndexConnectionBroker.java:49)
at org.neo4j.index.impl.lucene.LuceneIndex.getConnection(LuceneIndex.java:85)
at org.neo4j.index.impl.lucene.LuceneIndex.add(LuceneIndex.java:138)
at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy.add(AbstractIndexingTypeRepresentationStrategy.java:124)
at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy.addToTypesIndex(AbstractIndexingTypeRepresentationStrategy.java:116)
at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy.writeTypeTo(AbstractIndexingTypeRepresentationStrategy.java:59)
at org.springframework.data.neo4j.support.mapping.TRSTypeAliasAccessor.writeTypeTo(TRSTypeAliasAccessor.java:46)
at org.springframework.data.neo4j.support.mapping.TRSTypeAliasAccessor.writeTypeTo(TRSTypeAliasAccessor.java:26)

The solution is using transactions explicitly..
http://stackoverflow.com/questions/11485090/org-neo4j-graphdb-notintransactionexception

@Autowired
private GraphDatabaseService graphDb;

@Transactional
public void addRelation() {
  Transaction tx = graphDb.beginTx();
  ...
  tx.success(); //or tx.failure();
  tx.finish();
}

18 Ocak 2014 Cumartesi

the error:"Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.0.xsd)"

The error message is:

Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.0.xsd).

A related link:  http://stackoverflow.com/questions/7267341/validation-error-of-spring-beans-schema-inside-application-context
In summary, the error may be resolved by doing the following:
" It was caused by some cached files. After removing those items (Preferences -> General -> Network Connections -> Cache) everything worked as expected. "
However, in my condition it was not helpful :( Another cause is using different versions together as stated:
"This error may have appeared because you had a mix of 2.5 xsd and 3.0 xsd in your applicationContext.xml. "
When i removed the version info from every element in xsi:schemaLocation, the project compiled successfully..

8 Aralık 2013 Pazar

dependency injection in .net - ninject

i am spending this cold but bright sunday at home, since my mother had a simple surgery-like operation lately. So i am trying to solve some problems today to facilitate my week. One of those is refactoring my C# project by applying dependency injection.
Here is a short video which clearly explains the concept: http://www.youtube.com/watch?v=IKD2-MAkXyQ
My tool choice is ninject, since it is lightweight and does not require to write an xml for configuration. ( Despite being a SOA developer for several years in the past and dealt with bpel for a while, i still do not like using XML as a programming language. Here is an up-to-date discussion about it: http://programmers.stackexchange.com/questions/213316/xml-based-programming-languages )
Here is Ninject home page: http://www.ninject.org/
a sample chapter named Getting Started with Ninject can be downloaded from Scribd http://tr.scribd.com/doc/170865212/9781782166207-Mastering-Ninject-for-Dependency-Injection-Sample-Chapter
- a practical introduction mini-book: http://www.jeremybytes.com/Downloads/DependencyInjection.pdf
which barely mentions Ninject.

to start with Visual Studio 2013

i strongly recommend to watch http://www.youtube.com/watch?v=wa9Tvr9yiQs prior to development with Visual Studio 2013.