Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27220/src/net/sf/magicmap/server/cache
Modified Files:
PositionCache.java
Log Message:
Daten aus Chache in Datanbank schreiben (ServletContextListener)
Index: PositionCache.java
===================================================================
RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PositionCache.java 5 Dec 2005 16:11:43 -0000 1.8
--- PositionCache.java 6 Dec 2005 11:45:16 -0000 1.9
***************
*** 363,372 ****
while (mapNames.hasMoreElements()){
String currentMap = mapNames.nextElement();
- currentMap = currentMap.substring(0,currentMap.indexOf('#')-1);
PositionCacheEntry posCache = this.get(currentMap);
! PositionDTO[] positions = posCache.getPositionsSince(Long.valueOf(-1));
! for (int i = 0; i < positions.length; ++i){
! writePositionToDB(currentMap, positions[i]);
}
}
--- 363,374 ----
while (mapNames.hasMoreElements()){
String currentMap = mapNames.nextElement();
PositionCacheEntry posCache = this.get(currentMap);
! currentMap = currentMap.substring(0,currentMap.indexOf('#'));
! if(posCache != null){
! PositionDTO[] positions = posCache.getPositionsSince(Long.valueOf(-1));
! for (int i = 0; i < positions.length; ++i){
! writePositionToDB(currentMap, positions[i]);
}
+ }
}
|