Skip to content
Snippets Groups Projects
Commit 84228c5d authored by Gwenaelle ABEILLE's avatar Gwenaelle ABEILLE
Browse files

release hdbtdbArchivingApi-2.5.8

parent e8ed18ad
No related branches found
No related merge requests found
......@@ -9,7 +9,7 @@
</parent>
<groupId>fr.soleil.lib</groupId>
<artifactId>hdbtdbArchivingApi</artifactId>
<version>2.5.8-SNAPSHOT</version>
<version>2.5.8</version>
<name>hdbtdbArchivingApi</name>
<developers>
<developer>
......
......@@ -15,7 +15,7 @@ import fr.soleil.database.connection.AbstractDataBaseConnector;
public class AttributeIds extends AttributesData {
protected final Map<String, Integer> attributesIDs = new ConcurrentHashMap<String, Integer>();
private final static Map<String, Integer> ATTRIBUTE_ID_CACHE = new ConcurrentHashMap<String, Integer>();
public AttributeIds(final AbstractDataBaseConnector connector) {
super(connector);
......@@ -33,10 +33,7 @@ public class AttributeIds extends AttributesData {
public int getAttID(final String attributeName, final boolean caseSensitiveDb) throws ArchivingException {
int attributeID = getAttributeID(attributeName);
if (attributeID == 0) {
synchronized (this) {
attributeID = getAttributeID(attributeName);
// DBA-1178: reduce the attribute id recovery request
if (attributeID == 0) {
if (connector != null) {
ResultSet rset = null;
Connection conn = null;
......@@ -74,8 +71,6 @@ public class AttributeIds extends AttributesData {
}
}
}
}
}
return attributeID;
}
......@@ -128,7 +123,7 @@ public class AttributeIds extends AttributesData {
protected int getAttributeID(final String attributeName) {
int id;
final Integer temp = attributeName == null ? null : attributesIDs.get(attributeName.toLowerCase());
final Integer temp = attributeName == null ? null : ATTRIBUTE_ID_CACHE.get(attributeName.toLowerCase());
if (temp == null) {
id = 0;
} else {
......@@ -139,12 +134,12 @@ public class AttributeIds extends AttributesData {
protected void putAttributeID(final String attributeName, final int attributeID) {
if (attributeName != null) {
attributesIDs.put(attributeName.toLowerCase(), Integer.valueOf(attributeID));
ATTRIBUTE_ID_CACHE.put(attributeName.toLowerCase(), attributeID);
}
}
public void clear() {
attributesIDs.clear();
ATTRIBUTE_ID_CACHE.clear();
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment