Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8718209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:29:15+00:00 2026-06-13T06:29:15+00:00

I’m working about a identity, access and role management with SDN 2.1.0-RC4 without AspectJ.

  • 0

I’m working about a identity, access and role management with SDN 2.1.0-RC4 without AspectJ.
This system aims to manage around 120 000 users and data is extracted from legacy and HR applications.
I have from 500 to 30000 updates/day, so performance can be a touchy subject
I ran some workbenches with default configuration.

I used a very simple and stupid way.
A simple class

@TypeAlias("event")
@NodeEntity
public class Event {

    @GraphId
    private Long graphId;

    @Indexed
    private Long eventId;

    @RelatedTo(type="PREVIOUS_EVENT", direction=Direction.OUTGOING)
    private Event previous;

    private String description;

        /.../
}

and I insert data one by one

    /.../
/**
 * 
 */
public void loadAllData() {

    Event root = new Event();
    root.setEventId(0L);
    root.setDescription("ROOT");

    repository.save(root);
    Event curr = root;


    for(int i = 0; i< SIZE; i ++) {
        curr = insertData(curr, i );
    }
}


/**
 * @param curr
 * @param i
 * @return
 */
public Event insertData(Event curr, int i) {
    long lastTime = System.currentTimeMillis();
    Event evt = new Event();
    evt.setEventId(curr.getEventId()+1);
    evt.setPrevious(curr);
    evt.setDescription("event #"+i);
    repository.save(evt);
    curr = evt;
    delais[i] = System.currentTimeMillis() - lastTime;
    return curr;

}
/.../

I test several by overloading theses methods

1) use of @Transactional

@Override
@Transactional
public Event insertData(Event curr, int i) {
    return super.insertData(curr, i);
}

2) Use of neo4j transaction

@Override
public void loadAllData() {
    gds = getContext().getBean(GraphDatabaseService.class);
    super.loadAllData();
}       

@Override
public Event insertData(Event curr, int i) {                
    Transaction tx = gds.beginTx();
    try {
        curr = super.insertData(curr, i);
        tx.success();
    } catch(Exception e) {
        tx.failure();
    } finally {
        tx.finish();
    }
    return curr;

}

I know benchmark are a trolling subject and it’s not what I want. So take theses values as they are: a stupid test

Results

JtaTransactionManager

Mean 47,20 ms, Min 21,00 ms, Max 425,00 ms

GraphDatabaseService

Mean 0,90 ms, Min 0,00 ms, Max 3,00 ms

JtaTransactionManager is very slow compared to native neo4j server, but JtaTransactionManager is a global and ambitious TransactionManager.

My purpose is how to lighten or create a custom transactionManager with less ambition, a smaller scope but still using the @Transactional annotation ?

May be I’ve missed something ?

Thanks you for any potential help or advice.

PS: my configuration

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/data/neo4j http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

    <context:annotation-config/>
    <context:spring-configured/>

    <context:component-scan base-package="benchmark"/>

    <neo4j:repositories base-package="benchmark.repository"/>
    <neo4j:config graphDatabaseService="graphDatabaseService"/>


    <bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase" 
      destroy-method="shutdown">
         <constructor-arg index="0" value="data/benchmark.db" />
    </bean>


</beans>

Marc DeXeT

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:29:16+00:00Added an answer on June 13, 2026 at 6:29 am

    You use two totally differen transaction batch sizes.

    With the “neo4j” TM you use a global tx scope that includes all your updates in one go (aka several hundred or thousand ops).

    With the @Transactional you have a tx scope of a single operation. So the overhead of the transaction is added for each operation instead just once.

    So try to put an @Transactional around the loadAllData() instead.

    Also for a higher insertion speed try to use template.createRelationshipBetween(...., duplicate=true) instead of evt.setPrevious(curr). So you skip all the delta detection and duplication elimination.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.